1 /*=========================================================================
4 Module: $RCSfile: bbtkWxGUITextEditor.h,v $
6 Date: $Date: 2008/03/21 11:46:41 $
7 Version: $Revision: 1.1 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*//**
18 * \brief Short description in one line
20 * Long description which
21 * can span multiple lines
33 #ifdef _USE_WXWIDGETS_
36 #ifndef __bbtkWxGUITextEditor_h__
37 #define __bbtkWxGUITextEditor_h__
42 #include "bbtkInterpreter.h"
43 #include <wx/splitter.h>
44 #include <wx/aui/aui.h>
46 #include "bbtkWxGUICommand.h"
51 class WxTextCtrlGettingKeyEvents;
52 class WxGUITextEditorPage;
54 /// A bbs editor panel
55 class BBTK_EXPORT WxGUITextEditor : public wxPanel
58 WxGUITextEditor( wxWindow *parent );
61 void OnKeyDown(wxKeyEvent& event);
62 void OnKeyUp(wxKeyEvent& event);
64 void OnButtonNew(wxCommandEvent& event);
65 void OnButtonOpen(wxCommandEvent& event);
66 void OnButtonSave(wxCommandEvent& event);
67 // void OnButtonRun(wxCommandEvent& event);
68 // void OnButtonQuit(wxCommandEvent& event);
69 void OnPageClose(wxAuiNotebookEvent& evt);
73 void Open(const std::string& filename);
78 void HighlightSyntax();
81 void NewPage(const std::string& filename);
82 WxGUITextEditorPage* GetCurrentPage();
83 void FocusOnCurrentPage();
85 void SetFileNameFilter(const std::string& filter)
86 { mFileNameFilter = filter; }
90 wxAuiNotebook* mwxNotebook;
92 // Interpreter* mInterpreter;
93 // wxSplitterWindow* mwxSplit;
95 wxButton * mwxButtonNew;
96 wxButton * mwxButtonOpen;
97 wxButton * mwxButtonSave;
98 // wxButton * mwxButtonRun;
99 // wxButton * mwxButtonQuit;
100 wxStaticText* mwxPosition;
102 std::string mFileNameFilter;
115 DECLARE_EVENT_TABLE()
120 /// Editor in a frame
121 class BBTK_EXPORT WxGUITextEditorWindow : public wxFrame
122 //, public WxGUICommandUser
125 WxGUITextEditorWindow( wxWindow *parent, wxString title, wxSize size);
126 ~WxGUITextEditorWindow();
127 void Open(const std::string& filename) { mEditor->Open(filename); }
128 // void WxGUICommandEnter(const std::string& s);
133 WxGUITextEditor* mEditor;
140 #endif // __bbtkWxGUITextEditor_h__
142 #endif //_USE_WXWIDGETS_