class
UndoRedo
Provides functionality to undo or redo recently performed operations in the editor.
Public
Constructors
UndoRedo
Methods
~UndoRedo
Undo
Executes the last command on the undo stack, undoing its operations.
Redo
Executes the last command on the redo stack (last command we called undo on), re-applying its operation.
PushGroup
Creates a new undo/redo group.
All new commands will be registered to this group. You may remove the group and all of its commands by calling popGroup().
For example you might require global editor-wide undo/redo operations, and also more specific ones like input in an input box. When the user is done with the input box you no longer require its undo operations and you may use groups to easily remove them.
- name
- Unique name for the group.
PopGroup
Removes all the command registered to the current undo/redo group.
- name
- Unique name for the group.
RegisterOperation
Registers a new undo command.
GetTopCommandId
Returns the unique identifier for the command on top of the undo stack.
PopCommand
Removes a command from the undo/redo list, without executing it.
- id
- Identifier of the command returned by getTopCommandIdx().
Clear
Resets the undo/redo stacks.
Private
Methods
RemoveLastFromUndoStack
Removes the last undo command from the undo stack, and returns it.
AddToUndoStack
Adds a new command to the undo stack.
Returns the command that was replaced.
ClearUndoStack
Removes all entries from the undo stack.
ClearRedoStack
Removes all entries from the redo stack.