1 /*=========================================================================
4 Module: $RCSfile: bbtkWxEditor.h,v $
6 Date: $Date: 2008/03/19 08:03:59 $
7 Version: $Revision: 1.4 $
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 OnKeyDown(wxKeyEvent& event);
59 void OnKeyUp(wxKeyEvent& event);
61 void OnButtonNew(wxCommandEvent& event);
62 void OnButtonOpen(wxCommandEvent& event);
63 void OnButtonSave(wxCommandEvent& event);
64 void OnButtonRun(wxCommandEvent& event);
65 void OnButtonQuit(wxCommandEvent& event);
69 void Open(const std::string& filename);
75 void HighlightSyntax();
76 void UpdatePosition();
79 Interpreter* mInterpreter;
80 wxSplitterWindow* mwxSplit;
81 WxTextCtrlGettingKeyEvents* mwxInputText;
82 wxTextAttr* mwxInputTextAttr;
83 WxTextCtrlGettingKeyEvents* mwxOutputText;
84 wxTextAttr* mwxOutputTextAttr;
85 wxBitmapButton * mwxButtonNew;
86 wxButton * mwxButtonOpen;
87 wxButton * mwxButtonSave;
88 wxButton * mwxButtonRun;
89 wxButton * mwxButtonQuit;
90 wxStaticText* mwxPosition;
91 WxStreamRedirector* mRedirect_cout;
92 WxStreamRedirector* mRedirect_cerr;
106 DECLARE_EVENT_TABLE()
111 /// Editor in a frame
112 class BBTK_EXPORT WxEditorWindow : public wxFrame
115 WxEditorWindow( wxWindow *parent, wxString title, wxSize size);
117 void Open(const std::string& filename) { mEditor->Open(filename); }
126 #endif // __bbtkWxEditor_h__
128 #endif //_USE_WXWIDGETS_