UndoManager

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

Purpose

This module provides an undo context that may be plugged into other modules that are prepared 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 step of actions that can be undone/redone to get at a previous/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

Clears the undo/redo stack.

Undo

name: undo, type: Trigger

Perform undo in current undo context (if available).

Redo

name: redo, type: Trigger

Perform undo in current redo context (if available).

Hidden Fields

hasUndo

name: hasUndo, type: Bool, persistent: no

Shows if an undo operation is currently available.

hasRedo

name: hasRedo, type: Bool, persistent: no

Shows if an redo operation is currently available.

numUndoSteps

name: numUndoSteps, type: Integer, persistent: no

Number of currently available undo steps.

numRedoSteps

name: numRedoSteps, type: Integer, persistent: no

Number of currently available redo steps.

undoDescription

name: undoDescription, type: String, persistent: no

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

redoDescription

name: redoDescription, type: String, persistent: no

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

maxNumberUndoSteps

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