Access to global undo and redo functionality.
Users have the possibility of undoing and redoing actions performed using the GUI, and interacting with the undo and redo stacks with custom actions.
All undo/redo related functions should only be called inside UI event callback. Users should call TransactionBegin()/TransactionEnd() in pairs, Transaction stack must be closed before UI event callback return.
This class cannot be used as a base class.
Definition at line 79 of file fbundomanager.h.
#include <fbundomanager.h>
Public Member Functions |
|
FBUndoManager () | |
Constructor. |
|
bool | Clear () |
Clear the undo and redo stacks. |
|
void | Redo () |
Redo last undone action. |
|
void | Undo (bool pNoRedo=false) |
Undo last action. |
|
bool | TransactionBegin (char *pTransactionName) |
Open transaction stack for adding
transactions. |
|
bool | TransactionIsOpen () |
Query if transaction stack is already open.
|
|
bool | TransactionAdd (HFBUndo pUndo, FBArrayPlug *pDepdendPlugArray=NULL) |
Add Transaction if transaction stack is
open. |
|
bool | TransactionAddModelTRS (HFBModel pModel) |
Add Transaction if transaction stack is
open. |
|
bool | TransactionAddProperty (FBProperty *pProperty) |
Add Transaction if transaction stack is
open. |
|
bool | TransactionAddObjectDestroy (FBObject *pObject) |
Add Transaction if transaction stack is
open. |
|
bool | TransactionEnd () |
Close transaction stack. |
|
bool | ActiveOperation () |
Determine if an undo operation is in action.
|
FBUndoManager | ( | ) |
Constructor.
bool Clear | ( | ) |
Clear the undo and redo stacks.
void Redo | ( | ) |
Redo last undone action.
void Undo | ( | bool | pNoRedo = false |
) |
Undo last action.
pNoRedo | If true, once the action is undone, it cannot be redone. |
bool TransactionBegin | ( | char * | pTransactionName | ) |
Open transaction stack for adding transactions.
Users should call TransactionBegin()/TransactionEnd() in pairs, Transaction stack must be closed before UI event callback return.
pTransactionName | Name of Transaction. |
bool TransactionIsOpen | ( | ) |
Query if transaction stack is already open.
bool TransactionAdd | ( | HFBUndo | pUndo, |
FBArrayPlug * | pDepdendPlugArray =
NULL |
||
) |
Add Transaction if transaction stack is open.
Multiple custom actions could be added into transaction stack by calling this function multiple times.
pUndo | Custom undoable action to be added, FBUndoManager takes ownership of pUndo. |
pDepdendPlugArray | Usually you shold use the default value (NULL). |
bool TransactionAddModelTRS | ( | HFBModel | pModel | ) |
Add Transaction if transaction stack is open.
Quick Function to add Model TRS in Undo Stack
pModel | Model to backup TRS |
bool TransactionAddProperty | ( | FBProperty * | pProperty | ) |
Add Transaction if transaction stack is open.
Quick Function to add property value in Undo Stack
pProperty | Property to backup |
bool TransactionAddObjectDestroy | ( | FBObject * | pObject | ) |
Add Transaction if transaction stack is open.
Function to add object to destroy in Undo Stack
pObject | Object to backup |
bool TransactionEnd | ( | ) |
Close transaction stack.
Users should call TransactionBegin()/TransactionEnd() in pairs, Transaction stack must be closed before UI event callback return.
bool ActiveOperation | ( | ) |
Determine if an undo operation is in action.