X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_Icons_NDimensions%2FinterfMenuBar.h;h=28441b03d9132b4be75ee56bc46407bd48d0cc58;hb=5757258860acae97fa0f3449ef1354c87052d213;hp=53b11f726cfed685c5337130f2b4e6e51162de82;hpb=89db06fc8f04c54d2cee1b07a5abe3ac7ee6cf65;p=creaContours.git diff --git a/lib/Interface_Icons_NDimensions/interfMenuBar.h b/lib/Interface_Icons_NDimensions/interfMenuBar.h index 53b11f7..28441b0 100644 --- a/lib/Interface_Icons_NDimensions/interfMenuBar.h +++ b/lib/Interface_Icons_NDimensions/interfMenuBar.h @@ -10,7 +10,7 @@ #include //#include "interfMainPanel.h" -#include "wxContourEventHandler.h" +//#include "wxContourEventHandler.h" class interfMenuBar : @@ -55,11 +55,8 @@ public: for(int i = 0; i < vnom.size(); i++){ //sizex = vectbutton[i]->GetSize().GetWidth(); - //const std::string n = vnom[i]; - wxString newstring1(vnom[i].c_str() , wxConvUTF8); - //vectbutton[i]->SetToolTip(wxString(n)); - vectbutton[i]->SetToolTip(newstring1); - + std::string n = vnom[i]; + vectbutton[i]->SetToolTip(wxString(n.c_str(),wxConvUTF8)); //wxStaticText* statictext = getText(n, sizex, 15); //flexsizer->Add(statictext, wxEXPAND |wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTRE_HORIZONTAL|wxSHAPED); } @@ -76,13 +73,12 @@ 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(wxString(imgpath.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); + //wxSize(sizex,sizey) wxBitmapButton* bitmapbutton = new wxBitmapButton(this, -1, *bitmap, wxDefaultPosition, wxDefaultSize, - wxBU_AUTODRAW, wxDefaultValidator, _T("")); + wxBU_AUTODRAW, wxDefaultValidator, wxString(_T(""))); vectbutton.push_back(bitmapbutton); return bitmapbutton; @@ -97,10 +93,8 @@ public: **/ virtual wxStaticText* getText(std::string nom, int sizex, int sizey){ vectnom.push_back(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); + return new wxStaticText(this, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition, + wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8)); } /** ** Sets the vector funcion, this vector must contain a function for each button created @@ -143,7 +137,8 @@ public: **/ virtual void setButtonName(int i, const char c){ if(i < vectbutton.size()){ - vectbutton[i]->SetName(c); + std::string ac = c+""; + vectbutton[i]->SetName(wxString(ac.c_str(),wxConvUTF8)); } } @@ -155,14 +150,14 @@ public: **/ void onActionButtonPressed( wxCommandEvent& event ) { - if(eventHandler!=NULL) + if(true)//if(eventHandler!=NULL) { std::string theStr = std::string( ((wxButton *)event.GetEventObject())->GetName().ToAscii()); const char * toolCommand = theStr.c_str(); event.SetId( GetId() ); event.SetEventObject( this ); event.SetClientData( (void *) toolCommand); - eventHandler->ProcessEvent( event ); + //eventHandler->ProcessEvent( event ); } } @@ -184,7 +179,7 @@ private: wxFlexGridSizer* flexsizer; protected: - wxEvtHandler* eventHandler; + //wxEvtHandler* eventHandler; std::string datadir;