26 #ifndef __interfMENUBARH__
27 #define __interfMENUBARH__
33 #include <wx/bitmap.h>
34 #include <wx/bmpbuttn.h>
35 #include <wx/stattext.h>
47 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN){
49 wxInitAllImageHandlers();
55 virtual void initButtons(wxEvtHandler* evtHandler) = 0;
64 virtual void addButtons(std::vector<std::string> vpath, std::vector<std::string> vnom){
74 this->SetAutoLayout(
true );
77 for(
int i = 0; i < (int)(vpath.size());i++){
78 std::string p = vpath[i];
79 wxBitmapButton* bitmapbutton = this->
getButton(p, sizex, sizey);
80 flexsizer->Add(bitmapbutton,wxFIXED_MINSIZE);
85 for(
int i = 0; i < (int)(vnom.size()); i++){
87 std::string n = vnom[i];
88 vectbutton[i]->SetToolTip(wxString(n.c_str(),wxConvUTF8));
102 virtual wxBitmapButton*
getButton(std::string imgpath,
int sizex,
int sizey){
106 wxBitmap* bitmap =
new wxBitmap(wxString(imgpath.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
109 wxBitmapButton* bitmapbutton =
new wxBitmapButton(
this, -1, *bitmap, wxDefaultPosition, wxDefaultSize,
110 wxBU_AUTODRAW, wxDefaultValidator, wxString(_T(
"")));
123 virtual wxStaticText*
getText(std::string nom,
int sizex,
int sizey){
125 return new wxStaticText(
this, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition,
126 wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
134 for(
int i = 0; i < (int)(vectf.size());i++){
145 for(
int i = 0; i < (int)(
vectbutton.size());i++){
146 Connect(
vectbutton[i]->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
vectfunct[i],NULL,evtHandler);
156 for(
int i = 0; i < (int)(
vectbutton.size());i++){
169 std::string ac = c+
"";
170 vectbutton[i]->SetName(wxString(ac.c_str(),wxConvUTF8));
184 std::string theStr = std::string( ((wxButton *)event.GetEventObject())->GetName().ToAscii());
185 const char * toolCommand = theStr.c_str();
186 event.SetId( GetId() );
187 event.SetEventObject(
this );
188 event.SetClientData( (
void *) toolCommand);
195 for(
int i = 0; i < (int)(hand.size());i++){