]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContour_ButtonsBar.cxx
#3145 creaContours Bug New Normal - changeWx28to30
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContour_ButtonsBar.cxx
index 5e98af661c3a22ad090c13434c39079373e3c286..d920d9d7a6cbfbab73ecf7fcc0253192c1916f95 100644 (file)
@@ -1,3 +1,28 @@
+/*# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ */
+
 
 //----------------------------------------------------------------------------------------------------------------
 // Class definition include
 //------------------------------------------------------------------------------------------------------------
 #include "wxContour_ActionCommandsID.h"
 
+#include <string>
 #include "wx/toolbar.h"
 #include "wx/log.h"
 #include "wx/image.h"
 #include "wx/filedlg.h"
 #include "wx/spinctrl.h"
 #include "wx/srchctrl.h"
-
+#include <wx/wx.h>
 //------------------------------------------------------------------------------------------------------------
 // Generated events declaration and definition
 //------------------------------------------------------------------------------------------------------------
        :wxPanel( parent, id)//, pos, size, style, name)
        {
                //SetToolBitmapSize(wxSize(16,16));
-       
-       
-       wxString string_create(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::CREATE_TOOL] , wxConvUTF8);
-               
-        _createContour_Button = new wxButton( this, 
-          -1, 
-          _T("+ New Contour"), 
-          wxDefaultPosition, 
-          wxDefaultSize, 
-          0, 
-          wxDefaultValidator, 
-          string_create );
-       
+       std::string as = (char)wxContour_ActionCommandsID::CREATE_TOOL +"";
+        _createContour_Button = new wxButton( this, -1, _T("+ New Contour"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
 //             _createContour_Button->SetToolTip(_T("CTRL-N"));
                Connect( _createContour_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-
-       wxString string_delete(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::DELETE_TOOL] , wxConvUTF8);
-               _delete_Button = new wxButton( this, -1, _T("+ Delete"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_delete );
+               as = (char)wxContour_ActionCommandsID::DELETE_TOOL +"";
+               _delete_Button = new wxButton( this, -1, _T("+ Delete"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
                _delete_Button->SetToolTip(_T("BACK SPACE or DELETE key"));
                Connect( _delete_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
                _show_Button = new wxButton( this, -1, _T("Show"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::SHOW_TOOL );
                Connect( _show_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 */
-       wxString string_copy(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::COPY_TOOL] , wxConvUTF8);
-
-               _copy_Button = new wxButton( this, -1, _T("Copy"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_copy );
+               as = (char)wxContour_ActionCommandsID::COPY_TOOL +"";
+               _copy_Button = new wxButton( this, -1, _T("Copy"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
                _copy_Button->SetToolTip(_T("CTRL-C"));
-               Connect( _copy_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
-               
-       wxString string_paste(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::PASTE_TOOL] , wxConvUTF8);              
+               Connect( _copy_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-               _paste_Button = new wxButton( this, -1, _T("Paste"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_paste );
+               as = (char)wxContour_ActionCommandsID::PASTE_TOOL +"";
+               _paste_Button = new wxButton( this, -1, _T("Paste"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
                _paste_Button->SetToolTip(_T("CTRL-V"));
                Connect( _paste_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-       wxString string_change(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::CHANGE_TOOL] , wxConvUTF8);
-               _change_Button = new wxButton( this, -1, _T("    <-->  "), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_change );
+               as = (char)wxContour_ActionCommandsID::CHANGE_TOOL +"";
+               _change_Button = new wxButton( this, -1, _T("    <-->  "), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
                _change_Button->SetToolTip(_T("CTRL-K"));
                Connect( _change_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-       wxString string_save(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::SAVE_TOOL] , wxConvUTF8);
-               _save_Button = new wxButton( this, -1, _T("Save"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_save );
+               as = (char)wxContour_ActionCommandsID::SAVE_TOOL +"";
+               _save_Button = new wxButton( this, -1, _T("Save"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
                _save_Button->SetToolTip(_T("CTRL-S"));
-               Connect( _save_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
-               
-               
-       wxString string_open(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::OPEN_TOOL] , wxConvUTF8);
-               _open_Button = new wxButton( this, -1, _T("Open"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_open );
+               Connect( _save_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
+
+               as = (char)wxContour_ActionCommandsID::OPEN_TOOL +"";
+               _open_Button = new wxButton( this, -1, _T("Open"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
                _open_Button->SetToolTip(_T("CTRL-O"));
                Connect( _open_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-       wxString string_spread(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::SPREAD_TOOL] , wxConvUTF8);
-               _spread_Button = new wxButton( this, -1, _T("+ Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_spread );
+               as = (char)wxContour_ActionCommandsID::SPREAD_TOOL +"";
+               _spread_Button = new wxButton( this, -1, _T("+ Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
 //             _spread_Button->SetToolTip(_T("CTRL-XXXXXXX"));
                Connect( _spread_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-       wxString string_automatiqueSegmentation(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::AUTOMATIQUESEGMENTATION_TOOL] , wxConvUTF8);
-               _automatiqueSegmentation_Button = new wxButton( this, -1, _T("+ Segmentation"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_automatiqueSegmentation );
+               as = (char)wxContour_ActionCommandsID::AUTOMATIQUESEGMENTATION_TOOL +"";
+               _automatiqueSegmentation_Button = new wxButton( this, -1, _T("+ Segmentation"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
 //             _automatiqueSegmentation_Button->SetToolTip(_T("CTRL-XXXXXXX"));
                Connect( _automatiqueSegmentation_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-       wxString string_informationcontour(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::INFORMATIONCONTOUR_TOOL] , wxConvUTF8);
-               _informationContour_Button = new wxButton( this, -1, _T("+ Information"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_informationcontour );
+               as = (char)wxContour_ActionCommandsID::INFORMATIONCONTOUR_TOOL +"";
+               _informationContour_Button = new wxButton( this, -1, _T("+ Information"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
 //             _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX"));
                Connect( _informationContour_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-       wxString string_interfaceconfiguration(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::INTERFACECONFIGURATION_TOOL] , wxConvUTF8);
-               _interfaceConfiguration_Button = new wxButton( this, -1, _T("+ Configuration"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_interfaceconfiguration );
+               as = (char)wxContour_ActionCommandsID::INTERFACECONFIGURATION_TOOL +"";
+               _interfaceConfiguration_Button = new wxButton( this, -1, _T("+ Configuration"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
 //             _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX"));
                Connect( _interfaceConfiguration_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); 
 
-       wxString string_test(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::TEST_TOOL] , wxConvUTF8);
+
 //Test button Methods A-B-C in  Juan Carlos Prieto 22-09-08
-               _interfaceTest_Button = new wxButton( this, -1, _T("+ Test"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_test );
+               as = (char)wxContour_ActionCommandsID::TEST_TOOL +"";
+               _interfaceTest_Button = new wxButton( this, -1, _T("+ Test"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator,  wxString(as.c_str(),wxConvUTF8));
 //             _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX"));
                Connect( _interfaceTest_Button->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );