-/*=========================================================================
-
+/*=========================================================================
Program: bbtk
Module: $RCSfile: bbtkWxGUITextEditor.cxx,v $
Language: C++
- Date: $Date: 2008/10/03 14:27:52 $
- Version: $Revision: 1.17 $
-
- 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.
-
-=========================================================================*//**
+ Date: $Date: 2009/12/04 10:48:34 $
+ Version: $Revision: 1.21 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* 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.
+* ------------------------------------------------------------------------ */
+
+
+/**
* \brief Short description in one line
*
* Long description which
#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
// | 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);
//================================================================
WxGUITextEditorPage::~WxGUITextEditorPage()
{
+ delete mwxInputTextAttr;
+ delete mFixedFont;
}
//================================================================
}
}
// std::cout << "file [" << mName << "]" <<std::endl;
- mwxInputText->SaveFile(std2wx(mName));
+// mwxInputText->SaveFile(std2wx(mName));
+ SaveFile(mName);
mwxInputText->SetModified(false);
}
//================================================================
-
-
-
-
-
-
-
-
-
-
+ //================================================================
+ void WxGUITextEditorPage::SaveFile(const std::string& filename)
+ {
+ mwxInputText->SaveFile( std2wx(filename) );
+ }
+ //================================================================
+
+
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,
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);
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;
+
}
}
//================================================================
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);