1 #include "interfEditMenu.h"
4 interfEditMenu::interfEditMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir)
5 : interfMenuBar(parent, sizex, sizey)
7 this->datadir = datdir;
8 eventHandler = evtHandler;
12 void interfEditMenu::initButtons(wxEvtHandler* evtHandler) {
14 std::vector<std::string> path, nom;
15 std::vector<wxObjectEventFunction> funct;
17 path.push_back(datadir + "/copy.png");
18 nom.push_back("Copy the selected contour");
19 funct.push_back((wxObjectEventFunction) &interfMenuBar:: onActionButtonPressed);
21 path.push_back(datadir + "/paste.png");
22 nom.push_back("Paste the copied contour");
23 funct.push_back((wxObjectEventFunction) &interfMenuBar:: onActionButtonPressed);
25 path.push_back(datadir + "/undo.png");
26 nom.push_back("Undo");
27 funct.push_back((wxObjectEventFunction) &interfEditMenu:: onUndo);
29 path.push_back(datadir + "/redo.png");
30 nom.push_back("Redo");
31 funct.push_back((wxObjectEventFunction) &interfEditMenu:: onRedo);
33 this->addButtons(path, nom);
34 this->setVectorFunction(funct);
36 this->setButtonName(0, wxContour_ActionComman
\13dsID::COPY_TOOL);
37 this->setButtonName(1, wxContour_ActionComman
\13dsID::PASTE_TOOL);
38 this->setButtonName(2, '-');
39 this->setButtonName(3, '-');
41 this->connectEvents(evtHandler);
45 void interfEditMenu::onUndo(wxCommandEvent& event){
46 ((wxContourEventHandler*)this->eventHandler)->onUNDO();
48 void interfEditMenu::onRedo(wxCommandEvent& event){
49 ((wxContourEventHandler*)this->eventHandler)->onREDO();
52 interfEditMenu::~interfEditMenu()