#include "interfToolsMenu.h" #include "interfMainPanel.h" interfToolsMenu::interfToolsMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir) : interfMenuBar(parent, sizex, sizey) { this->datadir = datdir; //contourevent = (wxContourEventHandler*)evtHandler; //infoWin = NULL; configPanel = NULL; segmentPanel = NULL; spreadPanel = NULL; segmentPanelITK = NULL; // eventHandler = evtHandler; initButtons(this); } void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) { std::vector path, nom; std::vector funct; path.push_back(datadir + "/Spread.png"); nom.push_back("The selected contour will spread through all slides"); funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onRigidPressed); path.push_back(datadir + "/Spread1.png"); nom.push_back("Select more than one contour and find the contours between them"); funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onSpreadPressed); path.push_back(datadir + "/info.png"); nom.push_back("Information of the contours in the scene"); funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onInformationPressed); path.push_back(datadir + "/pignon.png"); nom.push_back("Configuration of the window"); funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onConfigurationPressed); path.push_back(datadir + "/Help.png"); nom.push_back("Show help page with information about the tools"); funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onHelpPressed); this->addButtons(path, nom); this->setVectorFunction(funct); //this->setButtonName(0, wxContour_ActionCommandsID::CHANGE_TOOL); this->connectEvents(evtHandler); } interfToolsMenu::~interfToolsMenu() { } /** ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name ** of the button corresponding to the method that has to be executed, ** it uses attribute eventHandler to call the methods define by the application. ** see setEventHandler(wxEventHandler*) **/ void interfToolsMenu::onRigidPressed(wxCommandEvent& event){ interfMainPanel::getInstance()->onRigidPressed(); } void interfToolsMenu::onSpreadPressed(wxCommandEvent& event){ interfMainPanel::getInstance()->onSpreadPressed(); } void interfToolsMenu::onInformationPressed(wxCommandEvent& event){ interfMainPanel::getInstance()->onInformationPressed(); } void interfToolsMenu::onConfigurationPressed(wxCommandEvent& event){ interfMainPanel::getInstance()->onConfigurationPressed(); } void interfToolsMenu::onHelpPressed(wxCommandEvent& event){ wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/creatools/node/25"), 0); }