From a62e394e0f56bb5adff696adf06be425680bddca Mon Sep 17 00:00:00 2001 From: jpr <> Date: Fri, 30 Apr 2010 02:38:01 +0000 Subject: [PATCH] std::string vs wxString --- .../bbsKernelEditorGraphic/CMakeLists.txt | 4 ++- .../bbsVtkGUIEditorGraphic/CMakeLists.txt | 5 +-- .../GObjectsMVCFactory.h | 1 + .../bbsWxGUIEditorGraphic/CMakeLists.txt | 3 +- .../bbtkwxGUIEditorGraphicBBS.cxx | 3 +- .../bbtkwxGUIEditorGraphicBBS.h | 3 +- .../bbsWxGUIEditorGraphic/wxEditionDialog.cxx | 34 ++++++++----------- .../wxGEditorTabPanel.cxx | 6 ++-- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt index a10999e..d4b20b9 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt @@ -5,8 +5,10 @@ FILE(GLOB bbsKernelEditorGraphic_H_SOURCES "." "*.h") INCLUDE_DIRECTORIES(../bbsWxGUIEditorGraphic) INCLUDE_DIRECTORIES(../bbsVtkGUIEditorGraphic) +INCLUDE_DIRECTORIES(../bbsKernelEditorGraphic) + +INCLUDE_DIRECTORIES(../../../data/icons) ADD_LIBRARY(bbsKernelEditorGraphic ${bbsKernelEditorGraphic_CXX_SOURCES} ${bbsKernelEditorGraphic_H_SOURCES} ) - diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/CMakeLists.txt b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/CMakeLists.txt index 654574c..4f4fecc 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/CMakeLists.txt +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/CMakeLists.txt @@ -5,9 +5,10 @@ FILE(GLOB bbsVtkGUIEditorGraphic_H_SOURCES "." "*.h") INCLUDE_DIRECTORIES(../bbsWxGUIEditorGraphic) INCLUDE_DIRECTORIES(../bbsKernelEditorGraphic) +INCLUDE_DIRECTORIES(../bbsVtkGUIEditorGraphic) + +INCLUDE_DIRECTORIES(../../../data/icons) ADD_LIBRARY(bbsVtkGUIEditorGraphic ${bbsVtkGUIEditorGraphic_CXX_SOURCES} ${bbsVtkGUIEditorGraphic_H_SOURCES} ) - - diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.h index 5235a8d..30d838c 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.h +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.h @@ -45,6 +45,7 @@ Version: $Revision$ //Includes same project #include "GlobalConstants.h" + #include "GObjectController.h" #include "GObjectModel.h" #include "vtkGObjectView.h" diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt index 034af95..741c06e 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt @@ -5,9 +5,10 @@ FILE(GLOB bbsWxGUIEditorGraphic_H_SOURCES "." "*.h") INCLUDE_DIRECTORIES(../bbsKernelEditorGraphic) INCLUDE_DIRECTORIES(../bbsVtkGUIEditorGraphic) +INCLUDE_DIRECTORIES(../bbsWxGUIEditorGraphic) + INCLUDE_DIRECTORIES(../../../data/icons) ADD_LIBRARY(bbsWxGUIEditorGraphic ${bbsWxGUIEditorGraphic_CXX_SOURCES} ${bbsWxGUIEditorGraphic_H_SOURCES} ) - diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 696214c..f4e7fdd 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -34,6 +34,7 @@ Version: $Revision$ */ #include "bbtkwxGUIEditorGraphicBBS.h" +#include "creaWx.h" namespace bbtk { @@ -296,7 +297,7 @@ namespace bbtk void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus) { - SetStatusText(_T(textStatus)); + SetStatusText(crea::std2wx(textStatus)); } //========================================================================= diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h index d81251d..5f3a91f 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h @@ -48,7 +48,8 @@ #include "wxPropertiesPanel.h" #include "wxEditionDialog.h" #include "wxVtkSceneManager.h" -#include "C:\RaC\CREATIS\bbtkGEditor\data\icons\wxart_new.xpm" +//#include "C:\RaC\CREATIS\bbtkGEditor\data\icons\wxart_new.xpm" // JPR +#include "wxart_new.xpm" // JPR //Includes creaMaracasVisu diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxEditionDialog.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxEditionDialog.cxx index 66a8fb0..d5e5cbd 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxEditionDialog.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxEditionDialog.cxx @@ -33,29 +33,28 @@ Version: $Revision$ * \brief Class bbtk::wxEditionDialog . */ - #include "wxEditionDialog.h" - +#include "creaWx.h" namespace bbtk { //========================================================================= - wxEditionDialog::wxEditionDialog(wxGUIEditorGraphicBBS *parent,GBlackBoxModel *model):wxDialog(parent,wxID_ANY,"", wxDefaultPosition, wxSize(480, 640)) + wxEditionDialog::wxEditionDialog(wxGUIEditorGraphicBBS *parent,GBlackBoxModel *model):wxDialog(parent,wxID_ANY,_T(""), wxDefaultPosition, wxSize(480, 640)) { _model=model; - std::string title = "BlackBox Editing - Name:"; + std::string title("BlackBox Editing - Name:"); title+=_model->getBBTKName(); title+=" Type:"; title+=_model->getBBTKType(); - SetTitle(wxT(title)); + SetTitle(std2wx(title)); constructBlackBoxEditionDialog(); } //========================================================================= - wxEditionDialog::wxEditionDialog(wxGUIEditorGraphicBBS *parent,wxVtkSceneManager* scene):wxDialog(parent, wxID_ANY, "", wxDefaultPosition, wxSize(300, 300)) + wxEditionDialog::wxEditionDialog(wxGUIEditorGraphicBBS *parent,wxVtkSceneManager* scene):wxDialog(parent, wxID_ANY, _T(""), wxDefaultPosition, wxSize(300, 300)) { } @@ -73,26 +72,26 @@ namespace bbtk { wxBoxSizer *sizerDialog = new wxBoxSizer(wxVERTICAL); - wxStaticText *text = new wxStaticText(this, -1, wxT("Input Ports")); + wxStaticText *text = new wxStaticText(this, -1, _T("Input Ports")); std::vector lstInputs = _model->getInputPorts(); wxGridSizer *sizer = new wxGridSizer(lstInputs.size(),3,5,5); for(int i = 0;igetBBTKName()),wxDefaultPosition,wxSize(100,30)); - wxStaticText *lblType = new wxStaticText(this, -1, wxT(port->getBBTKType()),wxDefaultPosition,wxSize(150,30)); - wxTextCtrl *txtValue = new wxTextCtrl(this, -1, wxT(""),wxDefaultPosition,wxSize(50,15)); + wxStaticText *lblName = new wxStaticText(this, -1, std2wx(port->getBBTKName()),wxDefaultPosition,wxSize(100,30)); + wxStaticText *lblType = new wxStaticText(this, -1, std2wx(port->getBBTKType()),wxDefaultPosition,wxSize(150,30)); + wxTextCtrl *txtValue = new wxTextCtrl(this, -1, _T(""),wxDefaultPosition,wxSize(50,15)); if(port->getValue()!="") { - txtValue->SetLabel(wxT(port->getValue())); + txtValue->SetLabel(crea::std2wx(port->getValue())); } if(port->isConnected()) { - std::string connected = "--Port Connected--"; - txtValue->SetLabel(wxT(connected)); + std::string connected("--Port Connected--"); + txtValue->SetLabel(crea::std2wx(connected)); txtValue->SetEditable(false); } @@ -103,12 +102,11 @@ namespace bbtk sizer->Add(lblName,0,wxEXPAND,5); sizer->Add(lblType,0,wxCENTRE|wxEXPAND,5); sizer->Add(txtValue,0,wxEXPAND,5); - } wxBoxSizer *buts = new wxBoxSizer(wxHORIZONTAL); - wxButton *okButton = new wxButton(this, 1003, wxT("Ok"),wxDefaultPosition, wxSize(70, 30)); - wxButton *closeButton = new wxButton(this, 1004, wxT("Close"), wxDefaultPosition, wxSize(70, 30)); + wxButton *okButton = new wxButton(this, 1003, _T("Ok"),wxDefaultPosition, wxSize(70, 30)); + wxButton *closeButton = new wxButton(this, 1004, _T("Close"), wxDefaultPosition, wxSize(70, 30)); // connect command event handlers Connect(1003,wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(wxEditionDialog::onClickOk)); @@ -127,7 +125,6 @@ namespace bbtk Centre(); ShowModal(); Destroy(); - } //========================================================================= @@ -137,7 +134,7 @@ namespace bbtk for(int i=0;i<_lstValues.size();i++) { - std::string text = _lstValues[i]->GetLabelText(); + std::string text = wx2std(_lstValues[i]->GetLabelText()); _model->setValueToInputPort(i,text); } @@ -156,4 +153,3 @@ namespace bbtk } // EO namespace bbtk // EOF - diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx index fc8b048..e2ead8f 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx @@ -35,7 +35,7 @@ Version: $Revision$ #include "wxGEditorTabPanel.h" - +#include "creaWx.h" namespace bbtk { @@ -79,7 +79,7 @@ namespace bbtk std::string packageName=""; std::string boxName=""; - wxString foo( wxT(data) ); + wxString foo( (data) ); char str[150]; strcpy( str, (const char*)foo.mb_str(wxConvUTF8) ); @@ -94,7 +94,6 @@ namespace bbtk _sceneManager->createGBlackBox(x,y,packageName, boxName); return true; - } //========================================================================= @@ -144,4 +143,3 @@ namespace bbtk } // EO namespace bbtk // EOF - -- 2.45.0