1 /*=========================================================================
4 Module: $RCSfile: bbtkWxEditor.h,v $
6 Date: $Date: 2008/03/18 13:50:43 $
7 Version: $Revision: 1.2 $
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"
47 class WxStreamRedirector;
48 class WxTextCtrlGettingKeyEvents;
50 /// A bbs editor panel
51 class BBTK_EXPORT WxEditor : public wxPanel
54 WxEditor( wxWindow *parent );
57 void OnKeyPress(wxKeyEvent& event);
59 void OnButtonNew(wxCommandEvent& event);
60 void OnButtonOpen(wxCommandEvent& event);
61 void OnButtonSave(wxCommandEvent& event);
62 void OnButtonRun(wxCommandEvent& event);
63 void OnButtonQuit(wxCommandEvent& event);
67 void Open(const std::string& filename);
73 void HighlightSyntax();
76 Interpreter* mInterpreter;
77 WxTextCtrlGettingKeyEvents* mwxInputText;
78 wxTextAttr* mwxInputTextAttr;
79 WxTextCtrlGettingKeyEvents* mwxOutputText;
80 wxTextAttr* mwxOutputTextAttr;
81 wxBitmapButton * mwxButtonNew;
82 wxButton * mwxButtonOpen;
83 wxButton * mwxButtonSave;
84 wxButton * mwxButtonRun;
85 wxButton * mwxButtonQuit;
86 WxStreamRedirector* mRedirect_cout;
87 WxStreamRedirector* mRedirect_cerr;
101 DECLARE_EVENT_TABLE()
106 /// Editor in a frame
107 class BBTK_EXPORT WxEditorWindow : public wxFrame
110 WxEditorWindow( wxWindow *parent, wxString title, wxSize size);
112 void Open(const std::string& filename) { mEditor->Open(filename); }
121 #endif // __bbtkWxEditor_h__
123 #endif //_USE_WXWIDGETS_