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 a single field.

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

When pressed, 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

When pressed, 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

When pressed, the complete history is cleared without touching the field 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).