Table of Contents

TTMSFNCUndoManager Class

Undo/redo manager that captures JSON state snapshots of an object and restores them in response to undo and redo requests.

API unit family: TMSFNCUndo Inherits from: TCollection

Syntax

TTMSFNCUndoManager = class(TCollection)

Properties

Name Description
MaxStackCount Maximum number of undo steps retained in the stack. Defaults to 20; oldest entries are dropped when the limit is reached.
Stack Provides indexed access to the raw undo stack entries.

Methods

Name Description
CanRedo Returns True when at least one state ahead of the current position is available to redo.
CanUndo Returns True when at least one state earlier than the current position is available to undo.
ClearUndoStack Removes all entries from the undo stack and records a fresh baseline state.
NextRedoAction Returns the action name of the state that would be applied by the next redo, or an empty string if no redo is available.
NextUndoAction Returns the action name of the state that would be restored by the next undo, or an empty string if no undo is available.
PushState Captures the current object state as a new undo entry; any states ahead of the current position are discarded.
Redo Re-applies the next state from the redo stack and moves the current position forward by one.
Undo Restores the previous state from the undo stack and moves the current position back by one.

Used by