68 FXIMPLEMENT_ABSTRACT(
GNEUndoList, FXUndoList, GNEUndoListMap, ARRAYNUMBER(GNEUndoListMap))
140 sender->handle(
this, enable ? FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE) : FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), 0);
141 FXString caption = undoName();
143 caption = (
"Cannot Undo in the middle of " +
myCommandGroups.top()->getDescription()).c_str();
144 }
else if (!canUndo()) {
148 if (dynamic_cast<FXMenuCommand*>(sender)) {
149 sender->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
158 sender->handle(
this, enable ? FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE) : FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), 0);
159 FXString caption = redoName();
161 caption = (
"Cannot Redo in the middle of " +
myCommandGroups.top()->getDescription()).c_str();
162 }
else if (!canRedo()) {
166 if (dynamic_cast<FXMenuCommand*>(sender)) {
167 sender->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
180 myDescription(description) {
FXDEFMAP(GNEUndoList) GNEUndoListMap[]
The main window of the Netedit.
const std::string myDescription
description of command
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void redo()
redo the last command group
void updateControls()
update control contents after undo/redo or recompute
void undo()
undo the last command group
void p_clear()
clears the undo list (implies abort)
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
the function-object for an editing operation (abstract base)
bool trueChange()
wether original and new value differ
bool hasCommandGroup() const
Check if undoList has command group.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
FXString redoName() const
get redo name
std::stack< CommandGroup * > myCommandGroups
GNEApplicationWindow *const myParent
void p_abort()
reverts and discards ALL active command groups
long p_onUpdRedo(FXObject *, FXSelector, void *)
event after Redo
CommandGroup(std::string description)
Constructor.
FXString undoName() const
get undo Name
const std::string & getDescription()
get description
long p_onUpdUndo(FXObject *, FXSelector, void *)