UndoManager

MLModule
genre Fields
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLUndoContext
definition MLUndoContext.def
keywords undo, redo, manager

Purpose

The module UndoManager provides an undo context that may be plugged into other modules that are designed to use it.

Usage

Connect the output of this module to all other modules with appropriate input connectors that should share the same undo context. The module panel shows the available undo/redo steps and the buttons to trigger them.

Details

An undo context is a series of actions that can be undone or redone to achieve a previous or later state of an edited object, document, etc.

Steps on the undo stack are automatically pushed to the redo stack when they are undone, and vice versa.

Tips

Disconnecting a module from this module will not only remove all undo steps of that module irrevocably, but also all steps that came before/after on the undo/redo stack, since it is assumed that preceding/later object/document states can’t be restored without these missing steps. The state of the object/document should not be changed by this.

Steps that can be undone independently probably should be handled by different undo contexts. The application developer is responsible for identifying suitable undo contexts and handling access to their undo/redo operations.

Windows

Default Panel

../../../Modules/Shared/MLUndoContext/mhelp/Images/Screenshots/UndoManager._default.png

Output Fields

outUndoContext

name: outUndoContext, type: UndoContext(MLBase)

Connect this to the same-typed input of modules with undoable operations.

For accessing this object via scripting see the Scripting Reference: MLUndoContextWrapper.

Parameter Fields

Field Index

Clear: Trigger Undo: Trigger
hasRedo: Bool undoDescription: String
hasUndo: Bool  
maxNumberUndoSteps: Integer  
numRedoSteps: Integer  
numUndoSteps: Integer  
Redo: Trigger  
redoDescription: String  

Visible Fields

Clear

name: clear, type: Trigger

When pressed, the undo/redo stack is cleared.

Undo

name: undo, type: Trigger

When pressed, an undo operation in the current undo context (if available) is performed.

Redo

name: redo, type: Trigger

When pressed, a redo operation in the current undo context (if available) is performed.

Hidden Fields

hasUndo

name: hasUndo, type: Bool, persistent: no

Shows whether an undo operation is currently available.

hasRedo

name: hasRedo, type: Bool, persistent: no

Shows whether a redo operation is currently available.

numUndoSteps

name: numUndoSteps, type: Integer, persistent: no

Shows the number of currently available undo steps.

numRedoSteps

name: numRedoSteps, type: Integer, persistent: no

Shows the number of currently available redo steps.

undoDescription

name: undoDescription, type: String, persistent: no

Shows a short descriptive name for the currently available undo operation.

redoDescription

name: redoDescription, type: String, persistent: no

Shows a short descriptive name for the currently available redo operation.

maxNumberUndoSteps

name: maxNumberUndoSteps, type: Integer, default: -1