interfEditMenu.cxx
Go to the documentation of this file.00001 #include "interfEditMenu.h"
00002
00003
00004 interfEditMenu::interfEditMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir)
00005 : interfMenuBar(parent, sizex, sizey)
00006 {
00007 this->datadir = datdir;
00008
00009 initButtons(this);
00010 }
00011
00012 void interfEditMenu::initButtons(wxEvtHandler* evtHandler) {
00013
00014 std::vector<std::string> path, nom;
00015 std::vector<wxObjectEventFunction> funct;
00016
00017 path.push_back(datadir + "/copy.png");
00018 nom.push_back("Copy the selected contour ctrl + c");
00019 funct.push_back((wxObjectEventFunction) &interfEditMenu:: onCopy);
00020
00021 path.push_back(datadir + "/paste.png");
00022 nom.push_back("Paste the copied contour ctrl + v");
00023 funct.push_back((wxObjectEventFunction) &interfEditMenu:: onPaste);
00024
00025 path.push_back(datadir + "/undo.png");
00026 nom.push_back("Undo ctrl + z");
00027 funct.push_back((wxObjectEventFunction) &interfEditMenu:: onUndo);
00028
00029 path.push_back(datadir + "/redo.png");
00030 nom.push_back("Redo ctrl + y");
00031 funct.push_back((wxObjectEventFunction) &interfEditMenu:: onRedo);
00032
00033
00034 this->addButtons(path, nom);
00035 this->setVectorFunction(funct);
00036
00037 this->setButtonName(0, 'C');
00038 this->setButtonName(1, 'P');
00039 this->setButtonName(2, '-');
00040 this->setButtonName(3, '-');
00041
00042 this->connectEvents(evtHandler);
00043
00044 }
00045 void interfEditMenu::onCopy(wxCommandEvent& event)
00046 {
00047 interfMainPanel::getInstance()->onCopy();
00048 }
00049
00050 void interfEditMenu::onPaste(wxCommandEvent& event)
00051 {
00052 interfMainPanel::getInstance()->onPaste();
00053 }
00054
00055 void interfEditMenu::onUndo(wxCommandEvent& event)
00056 {
00057 interfMainPanel::getInstance()->onUndo();
00058 }
00059
00060 void interfEditMenu::onRedo(wxCommandEvent& event)
00061 {
00062 interfMainPanel::getInstance()->onRedo();
00063 }
00064
00065 interfEditMenu::~interfEditMenu()
00066 {
00067 }
00068