43 #ifdef CHECK_MEMORY_LEAKS 72 FXIMPLEMENT_ABSTRACT(
GNEUndoList, FXUndoList, GNEUndoListMap, ARRAYNUMBER(GNEUndoListMap))
142 sender->handle(
this, enable ? FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE) : FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), 0);
143 FXString caption = undoName();
145 caption = (
"Cannot Undo in the middle of " +
myCommandGroups.top()->getDescription()).c_str();
146 }
else if (!canUndo()) {
150 if (dynamic_cast<FXMenuCommand*>(sender)) {
151 sender->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
160 sender->handle(
this, enable ? FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE) : FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), 0);
161 FXString caption = redoName();
163 caption = (
"Cannot Redo in the middle of " +
myCommandGroups.top()->getDescription()).c_str();
164 }
else if (!canRedo()) {
168 if (dynamic_cast<FXMenuCommand*>(sender)) {
169 sender->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
182 myDescription(description) {
FXDEFMAP(GNEUndoList) GNEUndoListMap[]
The main window of the Netedit.
FXString undoName() const
get undo Name
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
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.
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
bool hasCommandGroup() const
Check if undoList has command group.
CommandGroup(std::string description)
Constructor.
FXString redoName() const
get redo name
const std::string & getDescription()
get description
long p_onUpdUndo(FXObject *, FXSelector, void *)