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;
15 segmentPanelITK = NULL;
17 // eventHandler = evtHandler;
23 void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) {
25 std::vector<std::string> path, nom;
26 std::vector<wxObjectEventFunction> funct;
28 path.push_back(datadir + "/Spread.png");
29 nom.push_back("The selected contour will spread through all slides");
30 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onRigidPressed);
32 path.push_back(datadir + "/Spread1.png");
33 nom.push_back("Select more than one contour and find the contours between them");
34 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onSpreadPressed);
36 path.push_back(datadir + "/Mirror.png");
37 nom.push_back("Create an Axis and select a contour to mirror it accordingly");
38 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onMirrorPressed);
40 //CMRU 17-08-09 ------------------------------------------------------------------
41 path.push_back(datadir + "/Letter.PNG");
42 nom.push_back("Insert a Label");
43 funct.push_back((wxObjectEventFunction)&interfToolsMenu::onPrintLabel);
44 //-------------------------------------------------------------------------------
47 this->addButtons(path, nom);
48 this->setVectorFunction(funct);
50 //this->setButtonName(0, wxContour_ActionCommandsID::CHANGE_TOOL);
52 this->connectEvents(evtHandler);
57 interfToolsMenu::~interfToolsMenu()
62 ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
63 ** of the button corresponding to the method that has to be executed,
64 ** it uses attribute eventHandler to call the methods define by the application.
65 ** see setEventHandler(wxEventHandler*)
67 void interfToolsMenu::onRigidPressed(wxCommandEvent& event)
69 interfMainPanel::getInstance()->onRigidPressed();
72 void interfToolsMenu::onSpreadPressed(wxCommandEvent& event)
74 interfMainPanel::getInstance()->onSpreadPressed();
77 void interfToolsMenu::onMirrorPressed(wxCommandEvent& event)
79 interfMainPanel::getInstance()->onMirrorPressed();
82 void interfToolsMenu::onPrintLabel(wxCommandEvent& event)
84 interfMainPanel::getInstance()->onPrintLabel();