NAME

Prima::Widget::UndoActions - undo and redo the content of editable widgets

DESCRIPTION

Generic helpers that implement stored actions for undo/redo.

SYNOPSIS

Properties

undoLimit INTEGER

Sets limit on number of stored atomic undo operations. If 0, undo is disabled.

Methods

begin_undo_group

Opens bracket for group of actions, undone as single operation. The bracket is closed by calling end_undo_group.

can_undo, can_redo

Return boolean flags whether undo or redo could be done. Useful for graying a menu f ex.

end_undo_group

Closes bracket for group of actions, opened by begin_undo_group.

init_undo

Should be called once, inside init()

has_undo_action ACTION

Checks whether there is any ACTION in the undo list.

push_grouped_undo_action ACTION, @PARAMS

Stores a single undo action where ACTION is a method to be called inside undo/redo, if any. Each action is added to the last undo group, and will be removed/replayed together with the other actions in the group.

push_undo_action ACTION, @PARAMS

Stores a single undo action where ACTION is a method to be called inside undo/redo, if any. Each action is a single undo/redo operation.

redo

Re-applies changes, formerly rolled back by undo.

undo

Rolls back changes into internal array, which size cannot extend undoLimit value. In case undoLimit is 0, no undo actions can be made.

AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.

SEE ALSO

Prima, Prima::Edit,