1 #include "interfToolsMenu.h"
2 #include "interfMainPanel.h"
4 interfToolsMenu::interfToolsMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir)
5 : interfMenuBar(parent, sizex, sizey)
7 this->datadir = datdir;
8 //contourevent = (wxContourEventHandler*)evtHandler;
13 segmentPanelITK = NULL;
15 // eventHandler = evtHandler;
20 void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) {
22 std::vector<std::string> path, nom;
23 std::vector<wxObjectEventFunction> funct;
25 path.push_back(datadir + "/Spread.png");
26 nom.push_back("The selected contour will spread through all slides");
27 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onRigidPressed);
29 path.push_back(datadir + "/Spread1.png");
30 nom.push_back("Select more than one contour and find the contours between them");
31 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onSpreadPressed);
34 path.push_back(datadir + "/info.png");
35 nom.push_back("Information of the contours in the scene");
36 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onInformationPressed);
38 path.push_back(datadir + "/pignon.png");
39 nom.push_back("Configuration of the window");
40 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onConfigurationPressed);
42 path.push_back(datadir + "/Help.png");
43 nom.push_back("Show help page with information about the tools");
44 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onHelpPressed);
46 this->addButtons(path, nom);
47 this->setVectorFunction(funct);
49 //this->setButtonName(0, wxContour_ActionCommandsID::CHANGE_TOOL);
51 this->connectEvents(evtHandler);
56 interfToolsMenu::~interfToolsMenu()
61 ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
62 ** of the button corresponding to the method that has to be executed,
63 ** it uses attribute eventHandler to call the methods define by the application.
64 ** see setEventHandler(wxEventHandler*)
66 void interfToolsMenu::onRigidPressed(wxCommandEvent& event){
67 interfMainPanel::getInstance()->onRigidPressed();
70 void interfToolsMenu::onSpreadPressed(wxCommandEvent& event){
72 interfMainPanel::getInstance()->onSpreadPressed();
78 void interfToolsMenu::onInformationPressed(wxCommandEvent& event){
80 interfMainPanel::getInstance()->onInformationPressed();
85 void interfToolsMenu::onConfigurationPressed(wxCommandEvent& event){
87 interfMainPanel::getInstance()->onConfigurationPressed();
91 void interfToolsMenu::onHelpPressed(wxCommandEvent& event){
92 wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/creatools/node/25"), 0);