Public Member Functions

FBUndoManager Class Reference

Search for all occurrences

Detailed Description

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>

List of all members.

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.

Constructor & Destructor Documentation

Constructor.


Member Function Documentation

bool Clear ( )

Clear the undo and redo stacks.

Returns:
A boolean value indicating success (true) or failure (false).
void Redo ( )

Redo last undone action.

void Undo ( bool  pNoRedo = false)

Undo last action.

Parameters:
pNoRedoIf true, once the action is undone, it cannot be redone.
bool 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.

Parameters:
pTransactionNameName of Transaction.
Returns:
true if open transaction stack successfully.
bool TransactionIsOpen ( )

Query if transaction stack is already open.

Returns:
true if transaction is already open.
bool 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.

Parameters:
pUndoCustom undoable action to be added, FBUndoManager takes ownership of pUndo.
pDepdendPlugArrayUsually you shold use the default value (NULL).
Returns:
true if add transaction successfully.
bool TransactionAddModelTRS ( FBModel pModel)

Add Transaction if transaction stack is open.

Quick Function to add Model TRS in Undo Stack

Parameters:
pModelModel to backup TRS
Returns:
true if add transaction successfully.
bool TransactionAddProperty ( FBProperty pProperty)

Add Transaction if transaction stack is open.

Quick Function to add property value in Undo Stack

Parameters:
pPropertyProperty to backup
Returns:
true if add transaction successfully.
bool TransactionAddObjectDestroy ( FBObject pObject)

Add Transaction if transaction stack is open.

Function to add object to destroy in Undo Stack

Parameters:
pObjectObject to backup
Returns:
true if add transaction successfully.
bool TransactionEnd ( )

Close transaction stack.

Users should call TransactionBegin()/TransactionEnd() in pairs, Transaction stack must be closed before UI event callback return.

Returns:
true if transaction close successfully.
bool ActiveOperation ( )

Determine if an undo operation is in action.

Returns:
true the Undo Manager is performing an Undo or a Redo operation.

The documentation for this class was generated from the following file:

FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager
FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager FBUndoManager