#include "interfNewContourMenu.h" interfNewContourMenu::interfNewContourMenu(wxWindow * parent, int sizex, int sizey, wxEvtHandler* evtHandler, std::string datdir) : interfMenuBar(parent, sizex, sizey) { this->datadir = datdir; eventHandler = (wxContourEventHandler*)evtHandler; panBull = NULL; created = false; initButtons(evtHandler); } void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) { std::vector path, nom; std::vector funct; std::vector hand; path.push_back(datadir + "/Spline.png"); nom.push_back("Create a contour using splines"); funct.push_back(wxCommandEventHandler(wxContourEventHandler::onCreateContourSpline)); hand.push_back(evtHandler); path.push_back(datadir+"/Rectangle.png"); nom.push_back("Create a contour using the basic shape of a rectangle"); funct.push_back(wxCommandEventHandler(wxContourEventHandler::onCreateContourRectangle)); hand.push_back(evtHandler); path.push_back(datadir + "/Circle.png"); nom.push_back("Create a contour using the basic shape of a Circle"); funct.push_back(wxCommandEventHandler(wxContourEventHandler::onCreateContourCircle)); hand.push_back(evtHandler); path.push_back(datadir + "/bullseye.png"); nom.push_back("Create a contour using the bulls eye"); funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye); hand.push_back(this); this->addButtons(path, nom); this->setVectorFunction(funct); this->setEventHandlers(hand); this->connectEvents(); } interfNewContourMenu::~interfNewContourMenu() { } void interfNewContourMenu::onCreateContourBullseye(wxEvtHandler* evtHandler){ if(!created){ panBull = new PanelBullEyeOptions(interfMainPanel::getInstance()->getInfoPanel(), wxSize(100,200)); created = true; } eventHandler->createContourBullsEye(panBull); interfMainPanel::getInstance()->showPanel(panBull); }