1 #include "interfNewContourMenu.h"
4 interfNewContourMenu::interfNewContourMenu(wxWindow * parent, int sizex, int sizey, wxEvtHandler* evtHandler, std::string datdir)
5 : interfMenuBar(parent, sizex, sizey)
7 this->datadir = datdir;
8 //eventHandler = (wxContourEventHandler*)evtHandler;
16 void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) {
18 std::vector<std::string> path, nom;
19 std::vector<wxObjectEventFunction> funct;
20 std::vector<wxEvtHandler*> hand;
22 path.push_back(datadir + "/Spline.png");
23 nom.push_back("Create a contour using splines");
24 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourSpline);
25 hand.push_back(evtHandler);
27 path.push_back(datadir+"/Rectangle.png");
28 nom.push_back("Create a contour using the basic shape of a rectangle");
29 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourRectangle);
30 hand.push_back(evtHandler);
32 path.push_back(datadir + "/Circle.png");
33 nom.push_back("Create a contour using the basic shape of a Circle");
34 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourCircle);
35 hand.push_back(evtHandler);
37 path.push_back(datadir + "/bullseye.png");
38 nom.push_back("Create a contour using the bulls eye");
39 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye);
42 path.push_back(datadir + "/Line.png");
43 nom.push_back("Create a Line");
44 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
47 // RaC 09-09 ---------------------
48 path.push_back(datadir + "/Points.png");
49 nom.push_back("Create Points");
50 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
52 // RaC 09-09 ---------------------
54 // RaC 10-09 ---------------------
55 path.push_back(datadir + "/Polygon.png");
56 nom.push_back("Create Polygon");
57 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPolygon);
59 // RaC 10-09 ---------------------
61 this->addButtons(path, nom);
63 this->setVectorFunction(funct);
64 this->setEventHandlers(hand);
65 this->connectEvents();
71 interfNewContourMenu::~interfNewContourMenu()
75 void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event){
80 panBull = new PanelBullEyeOptions(interfMainPanel::getInstance()->getInfoPanel(),
84 interfMainPanel::getInstance()->onCreateContoursBullEye(panBull);
85 //eventHandler->createContourBullsEye(panBull);
86 interfMainPanel::getInstance()->showPanel(panBull);
90 void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event ){
91 interfMainPanel::getInstance()->onCreateContourSpline();
93 void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event ){
94 interfMainPanel::getInstance()->onCreateContourRectangle();
96 void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event ){
97 interfMainPanel::getInstance()->onCreateContourCircle();
99 void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
100 interfMainPanel::getInstance()->onCreateContourLine();
103 // RaC 09-09 ---------------------
104 void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){
105 interfMainPanel::getInstance()->onCreateContourPoints();
107 // RaC 09-09 ---------------------
109 // RaC 10-09 ---------------------
110 void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event ){
111 interfMainPanel::getInstance()->onCreateContourPolygon();
113 // RaC 10-09 ---------------------