X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWxGUITextEditor.cxx;h=e2f7fe46eada0f9f3346205ff88feac0f3089e44;hb=fc399c5aab38ad24ea5d57552701411b4d805181;hp=7de71068cb5abaf552737309a7d6c7bebbd4d0f3;hpb=0bfd6ea8a50ca866039ce1eabdb8df2b3a0330b1;p=bbtk.git diff --git a/kernel/src/bbtkWxGUITextEditor.cxx b/kernel/src/bbtkWxGUITextEditor.cxx index 7de7106..e2f7fe4 100644 --- a/kernel/src/bbtkWxGUITextEditor.cxx +++ b/kernel/src/bbtkWxGUITextEditor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxGUITextEditor.cxx,v $ Language: C++ - Date: $Date: 2008/03/21 11:46:41 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/03/21 14:59:39 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -96,42 +96,6 @@ namespace bbtk //================================================================ - //================================================================ - class WxGUITextEditorPage : public wxPanel - { - public: - WxGUITextEditorPage(wxWindow* parent, WxGUITextEditor* editor); - ~WxGUITextEditorPage(); - - void SetPageName(const std::string& name) { mName = name; } - const std::string& GetPageName() const { return mName; } - - bool AskFilename() const { return mAskFilename; } - - WxTextCtrlGettingKeyEvents* GetTextCtrl() { return mwxInputText; } - - void Load(const std::string& filename); - void Save(const std::string& filter); - - bool IsModified() { return mwxInputText->IsModified(); } - - private: - WxGUITextEditor* mEditor; - WxTextCtrlGettingKeyEvents* mwxInputText; - wxTextAttr* mwxInputTextAttr; - std::string mName; - bool mAskFilename; - - /* - enum - { - ID_InputText - }; - */ - //DECLARE_EVENT_TABLE(); - - } ; - //================================================================ //================================================================ /* BEGIN_EVENT_TABLE(WxGUITextEditorPage, wxPanel) @@ -185,6 +149,13 @@ namespace bbtk } //================================================================ + bool WxGUITextEditorPage::IsModified() + { return mwxInputText->IsModified(); } + + std::string WxGUITextEditorPage::GetText() + { + return wx2std(GetTextCtrl()->GetValue()); + } //================================================================ void WxGUITextEditorPage::Load(const std::string& filename) @@ -228,8 +199,10 @@ namespace bbtk //================================================================ //================================================================ - WxGUITextEditor::WxGUITextEditor( wxWindow *parent ) + WxGUITextEditor::WxGUITextEditor( wxWindow *parent, + WxGUITextEditorUser* user ) : wxPanel(parent, -1), + mUser(user), mFileNameFilter("*.*") { std::cout << "WxGUITextEditor::WxGUITextEditor"<Add( mwxButtonSave ); - /* wxBitmap bmp_run(cc_run_xpm); mwxButtonRun = new wxBitmapButton( btnsCtrlPanel,ID_ButtonRun,bmp_run);//_T("Run") ); btnsSizer->Add( mwxButtonRun ); + /* wxBitmap bmp_quit(cc_exit_xpm); mwxButtonQuit = new wxBitmapButton( btnsCtrlPanel,ID_ButtonQuit,bmp_quit);//_T("Quit") ); btnsSizer->Add( mwxButtonQuit ); @@ -435,14 +408,16 @@ namespace bbtk if (AskSave()) GetParent()->Close(); } //================================================================ - + */ //================================================================ void WxGUITextEditor::OnButtonRun(wxCommandEvent& event) { - Run(); + if (mUser!=0) mUser->WxGUITextEditorRun(); FocusOnCurrentPage(); } + + /* void WxGUITextEditor::Run() { std::cout << "-------------- RUN ---------------"<