]> Creatis software - creaContours.git/blob - lib/Interface_Icons_NDimensions/interfToolsMenu.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_Icons_NDimensions / interfToolsMenu.cxx
1 #include "interfToolsMenu.h"
2 #include "interfMainPanel.h"
3
4 interfToolsMenu::interfToolsMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir)
5         : interfMenuBar(parent, sizex, sizey)
6 {
7         this->datadir = datdir;
8         //contourevent = (wxContourEventHandler*)evtHandler;
9         //infoWin               = NULL;
10
11 /*EED Borrame
12         configPanel             = NULL;
13         segmentPanel    = NULL;
14         spreadPanel             = NULL;
15         segmentPanelITK = NULL;
16         
17 //      eventHandler = evtHandler;
18 */
19
20         initButtons(this);
21 }
22
23 void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) {
24
25         std::vector<std::string> path, nom;
26         std::vector<wxObjectEventFunction> funct;
27
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);
31
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);
35         
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);
39
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 //-------------------------------------------------------------------------------
45
46
47         this->addButtons(path, nom);    
48         this->setVectorFunction(funct);
49
50         //this->setButtonName(0, wxContour_ActionCommandsID::CHANGE_TOOL);
51
52         this->connectEvents(evtHandler);
53            
54
55 }
56
57 interfToolsMenu::~interfToolsMenu()
58 {
59 }
60
61 /**
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*)
66         **/
67 void interfToolsMenu::onRigidPressed(wxCommandEvent& event)
68 {
69         interfMainPanel::getInstance()->onRigidPressed();
70 }
71
72 void  interfToolsMenu::onSpreadPressed(wxCommandEvent& event)
73 {
74         interfMainPanel::getInstance()->onSpreadPressed();
75 }
76
77 void interfToolsMenu::onMirrorPressed(wxCommandEvent& event)
78 {
79   interfMainPanel::getInstance()->onMirrorPressed();
80 }
81
82 void interfToolsMenu::onPrintLabel(wxCommandEvent& event)
83 {
84         interfMainPanel::getInstance()->onPrintLabel();
85 }
86