The undo list manages a list of undoable (and redoable) commands for a FOX
application; it works hand-in-hand with subclasses of FXCommand and is an application of the well-known
Command pattern. Your application code should implement any number
of command classes and then add then to an FXUndoList instance. For an example of how this
works, see the textedit example program from the FXRuby distribution.
Class Constants
- FXUndoList::ID_UNDO
- Message identifier for the undo method. When a SEL_COMMAND message
with this identifier is sent to an undo list, it undoes the last command.
FXUndoList also provides a
SEL_UPDATE handler for this identifier, that enables or disables
the sender depending on whether it’s possible to undo.
- FXUndoList::ID_UNDO_ALL
- Message identifier for the "undo all" method. FXUndoList handles both the SEL_COMMAND
and SEL_UPDATE messages for this message identifier.
- FXUndoList::ID_REDO
- Message identifier for the redo method. When a SEL_COMMAND message
with this identifier is sent to an undo list, it redoes the last command.
FXUndoList also provides a
SEL_UPDATE handler for this identifier, that enables or disables
the sender depending on whether it’s possible to redo.
- FXUndoList::ID_REDO_ALL
- Message identifier for the "redo all" method. FXUndoList handles both the SEL_COMMAND
and SEL_UPDATE messages for this message identifier.
- FXUndoList::ID_CLEAR
- Message identifier for the "clear" method. FXUndoList handles both the SEL_COMMAND
and SEL_UPDATE messages for this message identifier.
- FXUndoList::ID_REVERT
- Message identifier for the "revert" method. FXUndoList handles both the SEL_COMMAND
and SEL_UPDATE messages for this message identifier.
Responder
Add new command (an FXCommand
instance) to the list. If doit is true, the command is
also executed.
Return true if we can still undo some commands (i.e. the undo list
is not empty).
Return true if we can still redo some commands (i.e. the redo list
is not empty).
Return true if there is a previously marked state that we can
revert to.
Returns the current undo command.
Returns the number of undo records.
Returns the total size of undo information.
Trim undo list down to at most nc commands.
Trim undo list down to at most size.
Return true if the undo list is marked.