This reference page is linked to from the following overview topics: Getting Notified of Source File Changes.
#include <fbundomanager.h>
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.
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 (const char *pTransactionName) |
Open transaction stack for adding
transactions. |
|
bool | TransactionIsOpen () |
Query if transaction stack is already open.
|
|
bool | TransactionAdd (FBUndo *pUndo, FBArrayPlug *pDepdendPlugArray=NULL) |
Add Transaction if transaction stack is
open. |
|
bool | TransactionAddModelTRS (FBModel *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::FBUndoManager | ( | ) |
Constructor.
bool FBUndoManager::Clear | ( | ) |
Clear the undo and redo stacks.
void FBUndoManager::Redo | ( | ) |
Redo last undone action.
void FBUndoManager::Undo | ( | bool | pNoRedo = false |
) |
Undo last action.
pNoRedo | If true, once the action is undone, it cannot be redone. |
bool FBUndoManager::TransactionBegin | ( | const 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 FBUndoManager::TransactionIsOpen | ( | ) |
Query if transaction stack is already open.
bool FBUndoManager::TransactionAdd | ( | FBUndo * | 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 FBUndoManager::TransactionAddModelTRS | ( | FBModel * | pModel | ) |
Add Transaction if transaction stack is open.
Quick Function to add Model TRS in Undo Stack
pModel | Model to backup TRS |
bool FBUndoManager::TransactionAddProperty | ( | FBProperty * | pProperty | ) |
Add Transaction if transaction stack is open.
Quick Function to add property value in Undo Stack
pProperty | Property to backup |
bool FBUndoManager::TransactionAddObjectDestroy | ( | FBObject * | pObject | ) |
Add Transaction if transaction stack is open.
Function to add object to destroy in Undo Stack
pObject | Object to backup |
bool FBUndoManager::TransactionEnd | ( | ) |
Close transaction stack.
Users should call TransactionBegin()/TransactionEnd() in pairs, Transaction stack must be closed before UI event callback return.
bool FBUndoManager::ActiveOperation | ( | ) |
Determine if an undo operation is in action.