Tyro/src/widgets/EditPane.h

37 lines
935 B
C
Raw Normal View History

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
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 ReApplyTheme(string theme="");
void ApplyTheme(string lang, string theme="");
string GetCurrentLang();
void SetCurrentLang(string name);
protected:
2015-04-16 11:23:08 -04:00
StringConstMap::iterator lexerMapIt;
LangConfig *lang_config = nullptr;
ThemeConfig *theme_config = nullptr;
2015-04-17 16:55:48 -04:00
bool FileReadable();
bool FileWritable();
void BindEvents();
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);
};