]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfMenuBar.h
Some fixes for wxString vs std::string pb.
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMenuBar.h
index 86a011a92e5b8068bea0de562d458b54b6c08ac2..53b11f726cfed685c5337130f2b4e6e51162de82 100644 (file)
@@ -55,8 +55,11 @@ public:
                
                for(int i = 0; i < vnom.size(); i++){
                        //sizex = vectbutton[i]->GetSize().GetWidth();
-                       std::string n = vnom[i];
-                       vectbutton[i]->SetToolTip(wxString(n));
+                       //const std::string n = vnom[i];
+                       wxString newstring1(vnom[i].c_str() , wxConvUTF8);
+                       //vectbutton[i]->SetToolTip(wxString(n));
+                       vectbutton[i]->SetToolTip(newstring1);
+                       
                        //wxStaticText* statictext = getText(n, sizex, 15);
                        //flexsizer->Add(statictext, wxEXPAND |wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTRE_HORIZONTAL|wxSHAPED);
                }
@@ -73,12 +76,13 @@ public:
        virtual wxBitmapButton* getButton(std::string imgpath, int sizex, int sizey){
                vectimgpath.push_back(imgpath);
                                
+               wxString newstring1( imgpath.c_str() , wxConvUTF8);
+               //wxBitmap* bitmap = new wxBitmap(imgpath,  wxBITMAP_TYPE_PNG);
+                wxBitmap* bitmap = new wxBitmap(newstring1,  wxBITMAP_TYPE_PNG);
                
-               wxBitmap* bitmap = new wxBitmap(imgpath, wxBITMAP_TYPE_PNG);
-
                //wxSize(sizex,sizey)
                wxBitmapButton* bitmapbutton = new wxBitmapButton(this, -1, *bitmap, wxDefaultPosition, wxDefaultSize,
-                                                                                       wxBU_AUTODRAW, wxDefaultValidator, wxString(""));
+                                                                                       wxBU_AUTODRAW, wxDefaultValidator, _T(""));
 
                vectbutton.push_back(bitmapbutton);
                return bitmapbutton;
@@ -93,8 +97,10 @@ public:
        **/
        virtual wxStaticText* getText(std::string nom, int sizex, int sizey){
                vectnom.push_back(nom);
-               return new wxStaticText(this, -1, wxString(nom), wxDefaultPosition, 
-                                                               wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom));
+               wxString newstring1(nom.c_str() , wxConvUTF8);
+               return new wxStaticText(this, -1, newstring1 /*wxString(nom)*/, wxDefaultPosition, 
+                                                               //wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom));
+                                                               wxSize(sizex,sizey), wxALIGN_CENTRE, newstring1);
        }
     /**
        **      Sets the vector funcion, this vector must contain a function for each button created