1 /*=========================================================================
4 Module: $RCSfile: bbtkWxEditor.h,v $
6 Date: $Date: 2008/03/20 09:51:29 $
7 Version: $Revision: 1.5 $
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 __bbtkWxEditor_h__
37 #define __bbtkWxEditor_h__
42 #include "bbtkInterpreter.h"
43 #include <wx/splitter.h>
45 #include "bbtkWxGUICommand.h"
50 class WxStreamRedirector;
51 class WxTextCtrlGettingKeyEvents;
53 /// A bbs editor panel
54 class BBTK_EXPORT WxEditor : public wxPanel
57 WxEditor( wxWindow *parent );
60 void OnKeyDown(wxKeyEvent& event);
61 void OnKeyUp(wxKeyEvent& event);
63 void OnButtonNew(wxCommandEvent& event);
64 void OnButtonOpen(wxCommandEvent& event);
65 void OnButtonSave(wxCommandEvent& event);
66 void OnButtonRun(wxCommandEvent& event);
67 void OnButtonQuit(wxCommandEvent& event);
71 void Open(const std::string& filename);
77 void HighlightSyntax();
78 void UpdatePosition();
82 Interpreter* mInterpreter;
83 wxSplitterWindow* mwxSplit;
84 WxTextCtrlGettingKeyEvents* mwxInputText;
85 wxTextAttr* mwxInputTextAttr;
86 WxTextCtrlGettingKeyEvents* mwxOutputText;
87 wxTextAttr* mwxOutputTextAttr;
88 wxButton * mwxButtonNew;
89 wxButton * mwxButtonOpen;
90 wxButton * mwxButtonSave;
91 wxButton * mwxButtonRun;
92 wxButton * mwxButtonQuit;
93 wxStaticText* mwxPosition;
94 WxStreamRedirector* mRedirect_cout;
95 WxStreamRedirector* mRedirect_cerr;
109 DECLARE_EVENT_TABLE()
114 /// Editor in a frame
115 class BBTK_EXPORT WxEditorWindow : public wxFrame, public WxGUICommandUser
118 WxEditorWindow( wxWindow *parent, wxString title, wxSize size);
120 void Open(const std::string& filename) { mEditor->Open(filename); }
121 void WxGUICommandEnter(const std::string& s);
132 #endif // __bbtkWxEditor_h__
134 #endif //_USE_WXWIDGETS_