Tyro/src/widgets/EditPane.h

44 lines
823 B
C
Raw Normal View History

#ifndef TYROEDIT_PANE_H
#define TYROEDIT_PANE_H
#include "../wx_common.h"
#include "../settings/Config.h"
2015-04-10 15:11:15 -04:00
#include <wx/stc/stc.h>
class EditPane: public wxStyledTextCtrl
{
public:
EditPane(
wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint &post = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style =
#ifndef __WXMAC__
wxSUNKEN_BORDER |
#endif
wxVSCROLL
);
~EditPane();
wxString fileName;
string GetLangByFile();
2015-04-10 15:11:15 -04:00
bool LoadAndHighlight(wxString filePath);
bool SaveFile();
bool SaveFile(const wxString &filename);
bool IsModified();
private:
2015-04-16 11:23:08 -04:00
StringConstMap lexerMap;
StringConstMap::iterator lexerMapIt;
TyroConfig *config;
2015-04-13 13:01:25 -04:00
enum
{
2015-04-16 22:07:51 -04:00
MARGIN_FOLD,
MARGIN_LINE_NUMBERS
2015-04-13 13:01:25 -04:00
};
void BindEvents();
void OnMarginClick(wxStyledTextEvent &event);
};
#endif // TYRODOC_FRAME_H