Tyro/src/widgets/EditPane.h

46 lines
1018 B
C
Raw Normal View History

#ifndef TYROEDIT_PANE_H
#define TYROEDIT_PANE_H
2015-04-29 17:03:15 -04:00
#include "../settings/LangConfig.h"
#include "../settings/ThemeConfig.h"
2015-04-10 15:11:15 -04:00
#include <wx/stc/stc.h>
class EditPane: public wxStyledTextCtrl
{
public:
EditPane(
2015-04-21 14:07:04 -04:00
wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint &post = wxDefaultPosition,
const wxSize &size = wxDefaultSize
);
~EditPane();
2015-04-17 16:55:48 -04:00
wxFileName fileName;
bool Load(wxString filePath);
void Highlight(wxString filePath);
bool SaveFile();
bool SaveFile(const wxString &filename);
void ApplyTheme(string lang, string theme="");
private:
2015-04-16 11:23:08 -04:00
StringConstMap lexerMap;
StringConstMap::iterator lexerMapIt;
2015-04-29 17:03:15 -04:00
LangConfig *lang_config;
ThemeConfig *theme_config;
2015-04-29 17:03:15 -04:00
enum myMargins
2015-04-13 13:01:25 -04:00
{
2015-04-16 22:07:51 -04:00
MARGIN_FOLD,
MARGIN_SYMBOL,
2015-04-16 22:07:51 -04:00
MARGIN_LINE_NUMBERS
2015-04-13 13:01:25 -04:00
};
2015-04-17 16:55:48 -04:00
bool FileReadable();
bool FileWritable();
void BindEvents();
void OnMarginClick(wxStyledTextEvent &event);
void OnCharAdded(wxStyledTextEvent &event);
2015-04-21 14:07:04 -04:00
void SetTheme(string theme_name);
2015-04-29 17:03:15 -04:00
void _ApplyTheme(JsonValue &lexer_map);
};
#endif // TYRODOC_FRAME_H