/*========================================================================= Program: bbtk Module: $RCSfile: bbtkWxGUITextEditor.h,v $ Language: C++ Date: $Date: 2008/03/21 11:46:41 $ 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 __bbtkWxGUITextEditor_h__ #define __bbtkWxGUITextEditor_h__ #include "bbtkWx.h" #include "bbtkInterpreter.h" #include #include #include "bbtkWxGUICommand.h" namespace bbtk { class WxTextCtrlGettingKeyEvents; class WxGUITextEditorPage; /// A bbs editor panel class BBTK_EXPORT WxGUITextEditor : public wxPanel { public: WxGUITextEditor( wxWindow *parent ); ~WxGUITextEditor(); void OnKeyDown(wxKeyEvent& event); void OnKeyUp(wxKeyEvent& event); void OnButtonNew(wxCommandEvent& event); void OnButtonOpen(wxCommandEvent& event); void OnButtonSave(wxCommandEvent& event); // void OnButtonRun(wxCommandEvent& event); // void OnButtonQuit(wxCommandEvent& event); void OnPageClose(wxAuiNotebookEvent& evt); void New(); void Open(); void Open(const std::string& filename); void Save(); // void Run(); // void Quit(); void HighlightSyntax(); void UpdateInfo(); void NewPage(const std::string& filename); WxGUITextEditorPage* GetCurrentPage(); void FocusOnCurrentPage(); void SetFileNameFilter(const std::string& filter) { mFileNameFilter = filter; } private: wxAuiManager m_mgr; wxAuiNotebook* mwxNotebook; // Interpreter* mInterpreter; // wxSplitterWindow* mwxSplit; wxButton * mwxButtonNew; wxButton * mwxButtonOpen; wxButton * mwxButtonSave; // wxButton * mwxButtonRun; // wxButton * mwxButtonQuit; wxStaticText* mwxPosition; std::string mFileNameFilter; public: enum { ID_ButtonNew, ID_ButtonOpen, ID_ButtonSave // ID_ButtonRun, // ID_ButtonQuit }; DECLARE_EVENT_TABLE() }; /// Editor in a frame class BBTK_EXPORT WxGUITextEditorWindow : public wxFrame //, public WxGUICommandUser { public: WxGUITextEditorWindow( wxWindow *parent, wxString title, wxSize size); ~WxGUITextEditorWindow(); void Open(const std::string& filename) { mEditor->Open(filename); } // void WxGUICommandEnter(const std::string& s); private : WxGUITextEditor* mEditor; }; } // namespace bbtk #endif // __bbtkWxGUITextEditor_h__ #endif //_USE_WXWIDGETS_