1 /*=========================================================================
4 Module: $RCSfile: bbtkWxEditor.h,v $
6 Date: $Date: 2008/03/18 15:31:51 $
7 Version: $Revision: 1.3 $
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>
48 class WxStreamRedirector;
49 class WxTextCtrlGettingKeyEvents;
51 /// A bbs editor panel
52 class BBTK_EXPORT WxEditor : public wxPanel
55 WxEditor( wxWindow *parent );
58 void OnKeyPress(wxKeyEvent& event);
60 void OnButtonNew(wxCommandEvent& event);
61 void OnButtonOpen(wxCommandEvent& event);
62 void OnButtonSave(wxCommandEvent& event);
63 void OnButtonRun(wxCommandEvent& event);
64 void OnButtonQuit(wxCommandEvent& event);
68 void Open(const std::string& filename);
74 void HighlightSyntax();
77 Interpreter* mInterpreter;
78 wxSplitterWindow* mwxSplit;
79 WxTextCtrlGettingKeyEvents* mwxInputText;
80 wxTextAttr* mwxInputTextAttr;
81 WxTextCtrlGettingKeyEvents* mwxOutputText;
82 wxTextAttr* mwxOutputTextAttr;
83 wxBitmapButton * mwxButtonNew;
84 wxButton * mwxButtonOpen;
85 wxButton * mwxButtonSave;
86 wxButton * mwxButtonRun;
87 wxButton * mwxButtonQuit;
88 wxStaticText* mwxPosition;
89 WxStreamRedirector* mRedirect_cout;
90 WxStreamRedirector* mRedirect_cerr;
104 DECLARE_EVENT_TABLE()
109 /// Editor in a frame
110 class BBTK_EXPORT WxEditorWindow : public wxFrame
113 WxEditorWindow( wxWindow *parent, wxString title, wxSize size);
115 void Open(const std::string& filename) { mEditor->Open(filename); }
124 #endif // __bbtkWxEditor_h__
126 #endif //_USE_WXWIDGETS_