X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWxGUITextEditor.cxx;h=5f3aea8afe8f077f0ed4ef5a62fda940c58615dd;hb=fef49cf06296bb65a839585dba63f282a89d91fc;hp=5f065ff9f4ff859f66bce3e46149ec806d233116;hpb=6575a389b71b1b85c79e4444885becb76ecf16e4;p=bbtk.git diff --git a/kernel/src/bbtkWxGUITextEditor.cxx b/kernel/src/bbtkWxGUITextEditor.cxx index 5f065ff..5f3aea8 100644 --- a/kernel/src/bbtkWxGUITextEditor.cxx +++ b/kernel/src/bbtkWxGUITextEditor.cxx @@ -1,32 +1,39 @@ -/*========================================================================= +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + +/*========================================================================= Program: bbtk Module: $RCSfile: bbtkWxGUITextEditor.cxx,v $ Language: C++ - Date: $Date: 2008/10/17 08:18:15 $ - Version: $Revision: 1.18 $ + Date: $Date: 2012/11/16 08:49:01 $ + Version: $Revision: 1.22 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) -* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux -* -* This software is governed by the CeCILL-B license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL-B -* license as circulated by CEA, CNRS and INRIA at the following URL -* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -* or in the file LICENSE.txt. -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited -* liability. -* -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL-B license and that you accept its terms. -* ------------------------------------------------------------------------ */ + /** @@ -67,7 +74,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 @@ -166,14 +177,14 @@ namespace bbtk // | wxTAB_TRAVERSAL ); */ - wxFont* FixedFont = new wxFont(10, + mFixedFont = new wxFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false); mwxInputTextAttr = new wxTextAttr; - mwxInputTextAttr->SetFont(*FixedFont); + mwxInputTextAttr->SetFont(*mFixedFont); sizer->Add(mwxInputText,1,wxGROW); SetSizer(sizer); @@ -185,6 +196,8 @@ namespace bbtk //================================================================ WxGUITextEditorPage::~WxGUITextEditorPage() { + delete mwxInputTextAttr; + delete mFixedFont; } //================================================================ @@ -235,22 +248,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 +343,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 +370,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 +484,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 +767,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);