X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWxGUITextEditor.cxx;h=02096e5566c9791b9e7ed6f0f70b932fc236f933;hb=ad891a93d0f7aedabfb477c42829a60e4d46cb9a;hp=5f065ff9f4ff859f66bce3e46149ec806d233116;hpb=6575a389b71b1b85c79e4444885becb76ecf16e4;p=bbtk.git diff --git a/kernel/src/bbtkWxGUITextEditor.cxx b/kernel/src/bbtkWxGUITextEditor.cxx index 5f065ff..02096e5 100644 --- a/kernel/src/bbtkWxGUITextEditor.cxx +++ b/kernel/src/bbtkWxGUITextEditor.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkWxGUITextEditor.cxx,v $ Language: C++ - Date: $Date: 2008/10/17 08:18:15 $ - Version: $Revision: 1.18 $ + Date: $Date: 2009/05/28 08:12:07 $ + Version: $Revision: 1.20 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -67,7 +67,11 @@ #include "../data/icons/wxart_filesaveas.xpm" //#include "../data/icons/wxart_exefile.xpm" //#include "../data/icons/wxart_delete.xpm" -#include "../data/icons/wxart_down.xpm" +//#include "../data/icons/wxart_down.xpm" +#include "../data/icons/wxart_run.xpm" +#include "../data/icons/wxart_runbbi.xpm" +#include "../data/icons/wxart_graphsimple.xpm" +#include "../data/icons/wxart_graphdetail.xpm" #include "../data/icons/wxart_eldel.xpm" namespace bbtk @@ -235,22 +239,21 @@ namespace bbtk } } // std::cout << "file [" << mName << "]" <SaveFile(std2wx(mName)); +// mwxInputText->SaveFile(std2wx(mName)); + SaveFile(mName); mwxInputText->SetModified(false); } //================================================================ - - - - - - - - - - + //================================================================ + void WxGUITextEditorPage::SaveFile(const std::string& filename) + { + mwxInputText->SaveFile( std2wx(filename) ); + } + //================================================================ + + @@ -331,7 +334,10 @@ namespace bbtk wxBitmap bmp_close(eldel_xpm); wxBitmap bmp_save(filesave_xpm); wxBitmap bmp_saveas(filesaveas_xpm); - wxBitmap bmp_run(down_xpm); + wxBitmap bmp_run(wxart_run_xpm); + wxBitmap bmp_runbbi(wxart_runbbi_xpm); + wxBitmap bmp_graphsimple(wxart_graphsimple_xpm); + wxBitmap bmp_graphdetail(wxart_graphdetail_xpm); mwxToolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, @@ -355,7 +361,22 @@ namespace bbtk mwxToolBar->AddTool(ID_ButtonRun, _T("Run"), bmp_run, wxNullBitmap, wxITEM_NORMAL, _T("Run file"), _T("Run current file")); - + + + mwxToolBar->AddTool(ID_ButtonGraphSimple, _T("Graph (simple)"), + bmp_graphsimple, wxNullBitmap, wxITEM_NORMAL, + _T("Graph simple"), _T("Simple graph of actual script")); + + mwxToolBar->AddTool(ID_ButtonGraphDetail, _T("Graph (detail)"), + bmp_graphdetail, wxNullBitmap, wxITEM_NORMAL, + _T("Graph (detail)"), _T("Detail graph of actual script")); + + mwxToolBar->AddTool(ID_ButtonRunBBI, _T("Run external bbi "), + bmp_runbbi, wxNullBitmap, wxITEM_NORMAL, + _T("Run external bbi"), _T("Run external bbi")); + + + mwxToolBar->AddSeparator(); mwxPosition = new wxStaticText ( mwxToolBar, -1, _T("")); mwxToolBar->AddControl(mwxPosition); @@ -454,10 +475,29 @@ namespace bbtk SaveCurrentPage(); break; case ID_ButtonRun : - if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) + if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) mUser->WxGUITextEditorRun(); FocusOnCurrentPage(); break; + + case ID_ButtonGraphSimple : + if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) + mUser->WxGUITextEditorGraphSimple(); + FocusOnCurrentPage(); + break; + + case ID_ButtonGraphDetail : + if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) + mUser->WxGUITextEditorGraphDetail(); + FocusOnCurrentPage(); + break; + + case ID_ButtonRunBBI : + if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) + mUser->WxGUITextEditorRunBBI(); + FocusOnCurrentPage(); + break; + } } //================================================================ @@ -718,7 +758,8 @@ namespace bbtk SetSizer(sizer); // parent window of all bbtk windows will be a child of this - Wx::SetTopWindowParent(this); + // Wx::SetTopWindowParent(this); + Wx::SetTopWindow(this); // Add the method OnWxSignal as a Wx::Signal observer //bbtkAddWxSignalObserver(WxGUITextEditorWindow::OnWxSignal);