2015-04-02 18:00:50 -04:00
|
|
|
#ifndef TYROEDIT_PANE_H
|
|
|
|
#define TYROEDIT_PANE_H
|
|
|
|
|
2015-04-29 17:03:15 -04:00
|
|
|
#include "../settings/LangConfig.h"
|
2015-05-07 14:06:12 -04:00
|
|
|
#include "../settings/ThemeConfig.h"
|
2015-04-10 15:11:15 -04:00
|
|
|
|
2015-04-02 18:00:50 -04:00
|
|
|
class EditPane: public wxStyledTextCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EditPane(
|
2015-04-21 14:07:04 -04:00
|
|
|
wxWindow *parent,
|
2015-04-02 18:00:50 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint &post = wxDefaultPosition,
|
2015-04-24 16:55:10 -04:00
|
|
|
const wxSize &size = wxDefaultSize
|
2015-04-02 18:00:50 -04:00
|
|
|
);
|
|
|
|
~EditPane();
|
2015-04-17 16:55:48 -04:00
|
|
|
wxFileName fileName;
|
|
|
|
bool Load(wxString filePath);
|
|
|
|
void Highlight(wxString filePath);
|
2015-04-16 17:03:27 -04:00
|
|
|
bool SaveFile();
|
|
|
|
bool SaveFile(const wxString &filename);
|
2015-05-27 11:37:02 -04:00
|
|
|
void ReApplyTheme(string theme="");
|
2015-05-07 17:05:27 -04:00
|
|
|
void ApplyTheme(string lang, string theme="");
|
2015-05-12 16:30:22 -04:00
|
|
|
string GetCurrentLang();
|
2015-05-13 16:55:44 -04:00
|
|
|
void SetCurrentLang(string name);
|
2015-06-19 15:54:18 -04:00
|
|
|
protected:
|
2015-04-16 11:23:08 -04:00
|
|
|
StringConstMap::iterator lexerMapIt;
|
2015-06-03 17:06:55 -04:00
|
|
|
LangConfig *lang_config = nullptr;
|
|
|
|
ThemeConfig *theme_config = nullptr;
|
2015-04-17 16:55:48 -04:00
|
|
|
bool FileReadable();
|
|
|
|
bool FileWritable();
|
2015-04-16 17:03:27 -04:00
|
|
|
void BindEvents();
|
2015-04-28 14:58:52 -04:00
|
|
|
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);
|
2015-04-02 18:00:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TYRODOC_FRAME_H
|