FieldUndo

MacroModule
genre Fields
author MeVis Medical Solutions AG
package MeVisLab/Standard
definition helpers.def
see also SettingsManager, FieldIterator
keywords fields, changes, history

Purpose

The module FieldUndo provides simple undo and redo functionality to single fields.

Usage

To facilitate the undo and redo, simply connect an arbitrary field in both directions to the value field of the FieldUndo module.

Windows

Default Panel

../../../Modules/Macros/Helpers/mhelp/Images/Screenshots/FieldUndo._default.png

Parameter Fields

Field Index

Clear: Trigger
History Size: Integer
historySizeMax: Integer
Index: Integer
Redo: Trigger
Size: Integer
Undo: Trigger
Value: String

Visible Fields

Value

name: value, type: String

Sets and shows the value. To be connected in both directions to the field that should have the undo/redo functionality.

History Size

name: historySize, type: Integer, default: 20, minimum: 1, maximum: :field:`historySizeMax`

Sets the maximum size of the undo history.

Size

name: size, type: Integer, persistent: no

Shows the current number of stored undo steps.

Index

name: index, type: Integer, default: 0, minimum: 0, maximum: 0

Sets the index to a specific value in the history.

The valid range is [0..size-1].

Undo

name: undo, type: Trigger

If pressed, the the value field is set to the previous value from the history.

This has the same effect as decreasing the index field. If index is already zero, nothing happens.

Redo

name: redo, type: Trigger

If pressed, the the value field is set to the next value from the history.

This has the same effect as increasing the index field. If index is already at its maximum (size - 1), nothing happens.

Clear

name: clear, type: Trigger

Clears the complete history, without touching the value.

The history size will be 1, afterwards (with index at zero).

Hidden Fields

historySizeMax

name: historySizeMax, type: Integer, default: 100

Maximum supported historySize (used for clamping the latter).