58 FXIMPLEMENT_ABSTRACT(
GNEUndoList, FXUndoList, GNEUndoListMap, ARRAYNUMBER(GNEUndoListMap))
67 myGNEApplicationWindowParent(parent) {
155 FXButton* button = dynamic_cast<FXButton*>(sender);
159 if (enable && !button->isEnabled()) {
160 sender->handle(
this, FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE),
nullptr);
162 }
else if (!enable && button->isEnabled()) {
163 sender->handle(
this, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
167 sender->handle(
this, enable ? FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE) : FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
170 FXMenuCommand* menuCommand = dynamic_cast<FXMenuCommand*>(sender);
174 FXString caption = undoName();
179 caption = (
"Cannot Undo in the middle of " +
myCommandGroups.top()->getDescription()).c_str();
180 }
else if (!canUndo()) {
183 menuCommand->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
184 menuCommand->update();
195 FXButton* button = dynamic_cast<FXButton*>(sender);
199 if (enable && !button->isEnabled()) {
200 sender->handle(
this, FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE),
nullptr);
202 }
else if (!enable && button->isEnabled()) {
203 sender->handle(
this, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
207 sender->handle(
this, enable ? FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE) : FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE),
nullptr);
210 FXMenuCommand* menuCommand = dynamic_cast<FXMenuCommand*>(sender);
214 FXString caption = redoName();
219 caption = (
"Cannot Redo in the middle of " +
myCommandGroups.top()->getDescription()).c_str();
220 }
else if (!canRedo()) {
223 menuCommand->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
224 menuCommand->update();
237 myDescription(description) {
243 return myDescription;
249 return (
"Undo " + myDescription).c_str();
255 return (
"Redo " + myDescription).c_str();