X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWxGUITextEditor.cxx;h=a61de17e9a919d1610bd391a42414687c87ca537;hb=7a26044dd46cb80ab90ee1f63d3b4d8ce52b2d39;hp=cec220f89f954cdf855135a6f37e355bfe68b697;hpb=9ef91d50684f8a5552f49e22a5b62e60fca7341b;p=bbtk.git diff --git a/kernel/src/bbtkWxGUITextEditor.cxx b/kernel/src/bbtkWxGUITextEditor.cxx index cec220f..a61de17 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/26 15:04:46 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/04/24 12:56:40 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -36,6 +36,7 @@ #include "bbtkWxGUITextEditor.h" #include "bbtkWxBlackBox.h" #include "bbtkConfigurationFile.h" +#include "bbtkUtilities.h" #include "icons/cc_new.xpm" #include "icons/cc_open.xpm" @@ -170,8 +171,8 @@ namespace bbtk //================================================================ void WxGUITextEditorPage::Load(const std::string& filename) { - std::cout << "-------------- LOAD ---------------"<SaveFile(std2wx(mName)); mwxInputText->SetModified(false); } @@ -215,7 +216,7 @@ namespace bbtk mUser(user), mFileNameFilter("*.*") { - std::cout << "WxGUITextEditor::WxGUITextEditor"<SetWxGUITextEditor(this); // mInterpreter->SetCommandLine(true); @@ -244,7 +245,8 @@ namespace bbtk | wxNO_BORDER); sizer->Add(mwxNotebook,1,wxGROW); - + + // BUTTONS wxPanel *btnsCtrlPanel = new wxPanel(this,-1); wxBoxSizer *btnsSizer = new wxBoxSizer(wxHORIZONTAL); @@ -295,6 +297,9 @@ namespace bbtk btnsSizer->Add( mwxPosition ); btnsCtrlPanel->SetSizer(btnsSizer); + btnsCtrlPanel->SetAutoLayout(true); + btnsCtrlPanel->Layout(); + sizer->Add ( btnsCtrlPanel, 0, wxLEFT | wxRIGHT | wxBOTTOM //| wxGROW , 10 ); @@ -329,7 +334,8 @@ namespace bbtk page->Load(name); } page->SetPageName(name); - mwxNotebook->AddPage(page,std2wx(name),true); + std::string fname = Utilities::get_file_name(name); + mwxNotebook->AddPage(page,std2wx(fname),true); FocusOnCurrentPage(); } //================================================================ @@ -358,7 +364,7 @@ namespace bbtk } void WxGUITextEditor::Open() { - std::cout << "-------------- OPEN ---------------"<GetPageCount()==0) return true; if (GetCurrentPage()->IsModified()) { @@ -466,7 +472,7 @@ namespace bbtk //================================================================ void WxGUITextEditor::OnPageClose(wxAuiNotebookEvent& evt) { - std::cout << "-------------- CLOSE ---------------"<Hide(); + // Creates the parent window of all bbtk windows as a child of this + Wx::CreateTopWindow(this); + // Add the method OnWxSignal as a Wx::Signal observer + //bbtkAddWxSignalObserver(WxGUITextEditorWindow::OnWxSignal); - Wx::SetTopWindow(top); SetAutoLayout(true); Layout();