/*========================================================================= Program: bbtk Module: $RCSfile: bbtkWxEditor.h,v $ Language: C++ Date: $Date: 2008/03/18 12:51:26 $ Version: $Revision: 1.1 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*//** * \brief Short description in one line * * Long description which * can span multiple lines */ /** * \file * \brief */ /** * \class bbtk:: * \brief */ #ifdef _USE_WXWIDGETS_ #ifndef __bbtkWxEditor_h__ #define __bbtkWxEditor_h__ #include "bbtkWx.h" #include "bbtkInterpreter.h" namespace bbtk { class WxStreamRedirector; class WxTextCtrlGettingKeyEvents; /// A bbs editor panel class BBTK_EXPORT WxEditor : public wxPanel { public: WxEditor( wxWindow *parent ); ~WxEditor(); void OnKeyPress(wxKeyEvent& event); void OnButtonNew(wxCommandEvent& event); void OnButtonOpen(wxCommandEvent& event); void OnButtonSave(wxCommandEvent& event); void OnButtonRun(wxCommandEvent& event); void OnButtonQuit(wxCommandEvent& event); void New(); void Open(); void Open(const std::string& filename); bool AskSave(); void Save(); void Run(); void Quit(); void HighlightSyntax(); private: Interpreter* mInterpreter; WxTextCtrlGettingKeyEvents* mwxInputText; wxTextAttr* mwxInputTextAttr; WxTextCtrlGettingKeyEvents* mwxOutputText; wxTextAttr* mwxOutputTextAttr; wxBitmapButton * mwxButtonNew; wxButton * mwxButtonOpen; wxButton * mwxButtonSave; wxButton * mwxButtonRun; wxButton * mwxButtonQuit; WxStreamRedirector* mRedirect_cout; WxStreamRedirector* mRedirect_cerr; public: enum { ID_InputText, ID_OutputText, ID_ButtonNew, ID_ButtonOpen, ID_ButtonSave, ID_ButtonRun, ID_ButtonQuit }; DECLARE_EVENT_TABLE() }; /// Editor in a frame class BBTK_EXPORT WxEditorWindow : public wxFrame { public: WxEditorWindow( wxWindow *parent, wxString title, wxSize size); ~WxEditorWindow(); }; } // namespace bbtk #endif // __bbtkWxEditor_h__ #endif //_USE_WXWIDGETS_