#include "interfEditMenu.h" interfEditMenu::interfEditMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir) : interfMenuBar(parent, sizex, sizey) { this->datadir = datdir; eventHandler = evtHandler; initButtons(this); } void interfEditMenu::initButtons(wxEvtHandler* evtHandler) { std::vector path, nom; std::vector funct; path.push_back(datadir + "/copy.png"); nom.push_back("Copy the selected contour"); funct.push_back((wxObjectEventFunction) &interfMenuBar:: onActionButtonPressed); path.push_back(datadir + "/paste.png"); nom.push_back("Paste the copied contour"); funct.push_back((wxObjectEventFunction) &interfMenuBar:: onActionButtonPressed); path.push_back(datadir + "/undo.png"); nom.push_back("Undo"); funct.push_back((wxObjectEventFunction) &interfEditMenu:: onUndo); path.push_back(datadir + "/redo.png"); nom.push_back("Redo"); funct.push_back((wxObjectEventFunction) &interfEditMenu:: onRedo); this->addButtons(path, nom); this->setVectorFunction(funct); this->setButtonName(0, wxContour_ActionCommandsID::COPY_TOOL); this->setButtonName(1, wxContour_ActionCommandsID::PASTE_TOOL); this->setButtonName(2, '-'); this->setButtonName(3, '-'); this->connectEvents(evtHandler); } void interfEditMenu::onUndo(wxCommandEvent& event){ ((wxContourEventHandler*)this->eventHandler)->onUNDO(); } void interfEditMenu::onRedo(wxCommandEvent& event){ ((wxContourEventHandler*)this->eventHandler)->onREDO(); } interfEditMenu::~interfEditMenu() { }