pyface.undo.undo_manager module

class pyface.undo.undo_manager.UndoManager[source]

Bases: HasTraits

The UndoManager class is the default implementation of the IUndoManager interface.

active_stack = Instance("pyface.undo.api.ICommandStack")

This is the currently active command stack and may be None. Typically it is set when some sort of editor becomes active.

active_stack_clean = Property(Bool)

This reflects the clean state of the currently active command stack. It is intended to support a “document modified” indicator in the GUI. It is maintained by the undo manager.

redo_name = Property(Str)

This is the name of the command that can be redone. It will be empty if there is no command that can be redone. It is maintained by the undo manager.

sequence_nr = Int()

This is the sequence number of the next command to be performed. It is incremented immediately before a command is invoked (by its ‘do()’ method).

stack_updated = Event()

This event is fired when the index of a command stack changes. The value of the event is the stack that has changed. Note that it may not be the active stack.

undo_name = Property(Str)

This is the name of the command that can be undone. It will be empty if there is no command that can be undone. It is maintained by the undo manager.

redo()[source]

Redo the last undone command of the active command stack.

undo()[source]

Undo the last command of the active command stack.