![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXUndoList.h>
Public Types | |
enum | { ID_CLEAR = FXWindow::ID_LAST, ID_REVERT, ID_UNDO, ID_REDO, ID_UNDO_ALL, ID_REDO_ALL, ID_UNDO_COUNT, ID_REDO_COUNT, ID_LAST } |
Public Member Functions | |
FXUndoList () | |
void | cut () |
void | add (FXCommand *command, FXbool doit=false, FXbool merge=true) |
void | begin (FXCommandGroup *command) |
void | end () |
void | abort () |
virtual void | undo () |
virtual void | redo () |
void | undoAll () |
void | redoAll () |
void | revert () |
FXbool | canUndo () const |
FXbool | canRedo () const |
FXbool | canRevert () const |
FXbool | busy () const |
FXCommand * | current () const |
virtual FXString | undoName () const |
virtual FXString | redoName () const |
FXint | undoCount () const |
FXint | redoCount () const |
virtual FXuint | size () const |
void | clear () |
void | trimCount (FXint nc) |
void | trimSize (FXuint sz) |
void | mark () |
void | unmark () |
FXbool | marked () const |
anonymous enum |
FX::FXUndoList::FXUndoList | ( | ) |
Make new empty undo list, initially unmarked.
void FX::FXUndoList::cut | ( | ) |
Cut the redo list.
This is automatically invoked when a new undo command is added.
Add new command, executing it if desired.
The new command will be merged with the previous command if merge is true and we're not at a marked position and the commands are mergeable. Otherwise the new command will be appended after the last undo command in the currently active undo group. If the new command is successfully merged, it will be deleted. Furthermore, all redo commands will be deleted since it is no longer possible to redo from this point.
void FX::FXUndoList::begin | ( | FXCommandGroup * | command | ) |
void FX::FXUndoList::end | ( | ) |
End undo command sub-group.
If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
void FX::FXUndoList::abort | ( | ) |
Abort the current command sub-group being compiled.
All commands already added to the sub-groups undo list will be discarded. Intermediate command groups will be left intact.
virtual void FX::FXUndoList::undo | ( | ) | [virtual] |
Undo last command.
This will move the command to the redo list.
Reimplemented from FX::FXCommandGroup.
virtual void FX::FXUndoList::redo | ( | ) | [virtual] |
Redo next command.
This will move the command back to the undo list.
Reimplemented from FX::FXCommandGroup.
void FX::FXUndoList::undoAll | ( | ) |
Undo all commands.
void FX::FXUndoList::redoAll | ( | ) |
Redo all commands.
void FX::FXUndoList::revert | ( | ) |
Revert to marked.
FXbool FX::FXUndoList::canUndo | ( | ) | const |
Can we undo more commands.
FXbool FX::FXUndoList::canRedo | ( | ) | const |
Can we redo more commands.
FXbool FX::FXUndoList::canRevert | ( | ) | const |
Can revert to marked.
FXbool FX::FXUndoList::busy | ( | ) | const [inline] |
Return true if currently inside undo or redo operation; this is useful to avoid generating another undo command while inside an undo operation.
FXCommand* FX::FXUndoList::current | ( | ) | const [inline] |
Current top level undo command.
virtual FXString FX::FXUndoList::undoName | ( | ) | const [virtual] |
Return name of the first undo command available; if no undo command available this will return the empty string.
Reimplemented from FX::FXCommand.
virtual FXString FX::FXUndoList::redoName | ( | ) | const [virtual] |
Return name of the first redo command available; if no Redo command available this will return the empty string.
Reimplemented from FX::FXCommand.
FXint FX::FXUndoList::undoCount | ( | ) | const [inline] |
Number of undo records.
FXint FX::FXUndoList::redoCount | ( | ) | const [inline] |
Number of redo records.
virtual FXuint FX::FXUndoList::size | ( | ) | const [virtual] |
void FX::FXUndoList::clear | ( | ) |
Clear list, and unmark all states.
All undo and redo information will be destroyed.
void FX::FXUndoList::trimCount | ( | FXint | nc | ) |
Trim undo list down to at most nc commands.
Call this periodically to prevent the undo-list from growing beyond a certain number of records.
void FX::FXUndoList::trimSize | ( | FXuint | sz | ) |
Trim undo list down to at most size sz.
Call this periodically to prevent the undo-list from growing beyond a certain amount of memory.
void FX::FXUndoList::mark | ( | ) |
Mark the current state of the undo list, which is initially unmarked.
There can be only one active mark at any time. Call mark() at any time when you know the document to be "clean"; for example when you save the document to disk.
void FX::FXUndoList::unmark | ( | ) |
Unmark all states in the undo list.
FXbool FX::FXUndoList::marked | ( | ) | const |
Check if the current state was marked, if the application has returned to the previously marked state.
![]() |