#ifndef __interfMENUBARH__
#define __interfMENUBARH__
+#include <string>
#include <wx/wx.h>
#include <vector>
#include <wx/image.h>
#include <wx/sizer.h>
//#include "interfMainPanel.h"
-#include "wxContourEventHandler.h"
+//#include "wxContourEventHandler.h"
class interfMenuBar :
int sizex = 80;
int sizey = 80;
- flexsizer = new wxFlexGridSizer(2,vpath.size(),2,2);
+ //RaC 11-09
+ //This constructor function as well but it is neccessary to change vpath.size() by 6
+ //flexsizer = new wxFlexGridSizer(2,vpath.size(),2,2);
+ flexsizer = new wxFlexGridSizer(6);
this->SetSizer(flexsizer, true);
this->SetAutoLayout( true );
//first row of the sizer, the buttons are being added
- for(int i = 0; i < vpath.size();i++){
+ for(int i = 0; i < (int)(vpath.size());i++){
std::string p = vpath[i];
wxBitmapButton* bitmapbutton = this->getButton(p, sizex, sizey);
flexsizer->Add(bitmapbutton,wxFIXED_MINSIZE);
}
//second row of the sizer, the names are being added
- for(int i = 0; i < vnom.size(); i++){
+ for(int i = 0; i < (int)(vnom.size()); i++){
//sizex = vectbutton[i]->GetSize().GetWidth();
std::string n = vnom[i];
- vectbutton[i]->SetToolTip(wxString(n));
+ 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);
}
vectimgpath.push_back(imgpath);
- wxBitmap* bitmap = new wxBitmap(imgpath, 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, wxString(""));
+ wxBU_AUTODRAW, wxDefaultValidator, wxString(_T("")));
vectbutton.push_back(bitmapbutton);
return bitmapbutton;
**/
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));
+ 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
** and name of the button. See addButton(<vect>, <vect>)
**/
virtual void setVectorFunction(std::vector<wxObjectEventFunction> vectf){
- for(int i = 0; i < vectf.size();i++){
+ for(int i = 0; i < (int)(vectf.size());i++){
vectfunct.push_back(vectf[i]);
}
}
**/
virtual void connectEvents(wxEvtHandler* evtHandler){
- for(int i = 0; i < vectbutton.size();i++){
+ for(int i = 0; i < (int)(vectbutton.size());i++){
Connect(vectbutton[i]->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, vectfunct[i],NULL,evtHandler);
}
}
**/
virtual void connectEvents(){
- for(int i = 0; i < vectbutton.size();i++){
+ for(int i = 0; i < (int)(vectbutton.size());i++){
Connect(vectbutton[i]->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, vectfunct[i],NULL,vecthand[i]);
}
}
** @params const char name of the button see wxContour_ActionCommandsID.h to view the commands
**/
virtual void setButtonName(int i, const char c){
- if(i < vectbutton.size()){
- vectbutton[i]->SetName(c);
+ if(i < (int)(vectbutton.size())){
+ std::string ac = c+"";
+ vectbutton[i]->SetName(wxString(ac.c_str(),wxConvUTF8));
}
}
**/
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 );
}
}
virtual void setEventHandlers(std::vector<wxEvtHandler*> hand){
- for(int i = 0; i < hand.size();i++){
+ for(int i = 0; i < (int)(hand.size());i++){
vecthand.push_back(hand[i]);
}
}
wxFlexGridSizer* flexsizer;
protected:
- wxEvtHandler* eventHandler;
+ //wxEvtHandler* eventHandler;
std::string datadir;