2016-01-13 09:29:09 -05:00
|
|
|
#pragma once
|
2015-07-07 10:01:17 -04:00
|
|
|
#include "src/widgets/widget.h"
|
|
|
|
#include "src/settings/LangConfig.h"
|
|
|
|
#include "src/settings/ThemeConfig.h"
|
|
|
|
|
2015-04-10 15:11:15 -04:00
|
|
|
|
2019-06-21 13:34:12 -04:00
|
|
|
class EditorPane: public wxStyledTextCtrl
|
2015-04-02 18:00:50 -04:00
|
|
|
{
|
|
|
|
public:
|
2019-06-21 13:34:12 -04:00
|
|
|
explicit EditorPane(
|
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
|
|
|
);
|
2019-06-21 13:34:12 -04:00
|
|
|
~EditorPane();
|
2015-04-17 16:55:48 -04:00
|
|
|
wxFileName fileName;
|
2019-05-30 15:09:42 -04:00
|
|
|
bool Load(const wxString &filePath);
|
|
|
|
void Highlight(const wxString &filePath);
|
2015-04-16 17:03:27 -04:00
|
|
|
bool SaveFile();
|
|
|
|
bool SaveFile(const wxString &filename);
|
2019-05-17 16:19:42 -04:00
|
|
|
void ReApplyTheme(const string &theme="");
|
|
|
|
void ApplyTheme(const string &lang, const string &theme="");
|
2015-05-12 16:30:22 -04:00
|
|
|
string GetCurrentLang();
|
2019-05-17 16:19:42 -04:00
|
|
|
void SetCurrentLang(const string &name);
|
2015-06-19 15:54:18 -04:00
|
|
|
protected:
|
2015-04-16 11:23:08 -04:00
|
|
|
StringConstMap::iterator lexerMapIt;
|
2015-04-17 16:55:48 -04:00
|
|
|
bool FileReadable();
|
|
|
|
bool FileWritable();
|
2015-04-16 17:03:27 -04:00
|
|
|
void BindEvents();
|
2019-06-24 16:08:22 -04:00
|
|
|
void _ApplyTheme(Json::Value &lexer_map);
|
2015-04-02 18:00:50 -04:00
|
|
|
};
|