]> 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         configPanel = NULL;
11         segmentPanel = NULL;
12         spreadPanel = NULL;
13         segmentPanelITK = NULL;
14         
15 //      eventHandler = evtHandler;
16
17         initButtons(this);
18 }
19
20 void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) {
21
22         std::vector<std::string> path, nom;
23         std::vector<wxObjectEventFunction> funct;
24
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);
28
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);
32
33         
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);
37
38         path.push_back(datadir + "/pignon.png");
39         nom.push_back("Configuration of the window");
40         funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onConfigurationPressed);
41
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);
45
46         path.push_back(datadir + "/Mirror.png");
47         nom.push_back("Create an Axis and select a contour to mirror it accordingly");
48         funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onMirrorPressed);
49
50         this->addButtons(path, nom);    
51         this->setVectorFunction(funct);
52
53         //this->setButtonName(0, wxContour_ActionCommandsID::CHANGE_TOOL);
54
55         this->connectEvents(evtHandler);
56            
57
58 }
59
60 interfToolsMenu::~interfToolsMenu()
61 {
62 }
63
64 /**
65         **      Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
66         **      of the button corresponding to the method that has to be executed,
67         **      it uses attribute eventHandler to call the methods define by the application.
68         **      see setEventHandler(wxEventHandler*)
69         **/
70 void interfToolsMenu::onRigidPressed(wxCommandEvent& event){
71         interfMainPanel::getInstance()->onRigidPressed();
72 }
73
74 void  interfToolsMenu::onSpreadPressed(wxCommandEvent& event){
75
76         interfMainPanel::getInstance()->onSpreadPressed();
77
78         
79 }
80
81
82 void  interfToolsMenu::onInformationPressed(wxCommandEvent& event){
83
84         interfMainPanel::getInstance()->onInformationPressed();
85
86         
87 }
88
89 void  interfToolsMenu::onConfigurationPressed(wxCommandEvent& event){
90
91         interfMainPanel::getInstance()->onConfigurationPressed();
92
93 }
94
95 void interfToolsMenu::onHelpPressed(wxCommandEvent& event){
96
97   wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/creatools/node/25"), 0);
98
99 }
100
101 void interfToolsMenu::onMirrorPressed(wxCommandEvent& event){
102
103   interfMainPanel::getInstance()->onMirrorPressed();
104
105 }
106