System CATCommandGlobalUndo

Usage: you can derive this class.


public class CATCommandGlobalUndo

Base class to create an undo/redo object for a command.
Role: This class provides methods to undo/redo the command global effects. CNext records instances of this class in a command history that enables the end user to undo the previous command. So, each instance of this class is created at the end of a command and is kept after the command deletion.
To create such an undo/redo object, you can derive this class and override the methods:

or instantiate a CATCommandGlobalUndo object and give as arguments the addresses of methods to execute to undo/redo the command.
Moreover, this undo/redo object must only undo/redo the objects that are not transactional, that is to say that don't belong to a model which implements the CATIUndoTransaction interface, because such a model undoes and redoes its objects itself. That's the reason why you can specify methods to be called before or after the transactional model undo/redo.


Constructor and Destructor Index


o CATCommandGlobalUndo()
Constructs an empty undo/redo object.
o CATCommandGlobalUndo(CATGlobalUndoMethod,CATGlobalUndoMethod,void*,CATGlobalUndoMethod)
Constructs an undo/redo object using undo/redo method addresses.
o ~CATCommandGlobalUndo()

Method Index


o AfterRedo()
Redoes the command effects after the transactional redo.
o AfterUndo()
Undoes the command effects after the transactional undo.
o BeforeRedo()
Redoes the command effects before the transactional undo.
o BeforeUndo()
Undoes the command effects before the transactional undo.
o SetAfterRedoMeth(CATGlobalUndoMethod)
Sets the method to redo the command effects after the transactional redo.
o SetAfterUndoMeth(CATGlobalUndoMethod)
Sets the method to undo the command effects after the transactional undo.
o SetBeforeRedoMeth(CATGlobalUndoMethod)
Sets the method to redo the command effects before the transactional redo.
o SetBeforeUndoMeth(CATGlobalUndoMethod)
Sets the method to undo the command effects before the transactional undo.
o SetData(void*)
Sets data which may be useful to undo/redo the command effects.
o SetDeallocateMeth(CATGlobalUndoMethod)
Sets the method to deallocate the data given with the SetData method.

Constructor and Destructor


o CATCommandGlobalUndo
public CATCommandGlobalUndo()
Constructs an empty undo/redo object.
o CATCommandGlobalUndo
public CATCommandGlobalUndo( iBeforeUndoMeth,
iBeforeRedoMeth,
iData,
iDeallocateMeth= NULL)
Constructs an undo/redo object using undo/redo method addresses.
Role: The addresses of the methods to execute to undo or redo the command effects are given as arguments. These methods must be static methods of the command, because the command is deleted after its completion, whereas the undo/redo methods may be called a long time after.
Parameters:
iBeforeUndoMeth
The method to undo the command effects before the transactional undo.
iBeforeRedoMeth
The method to redo the command effect before the transactional redo.
iData
An object that can be useful for the command undo/redo methods.
Cyclic reference: A copy of iData is kept. This object will be deallocated by the iDeallocateMeth method given as the fourth argument.
iDeallocateMeth
The method to deallocate the iData object passed as the third argument. This method is called when the undo/redo object is removed from the command history.
o ~CATCommandGlobalUndo
public ~CATCommandGlobalUndo()

Methods


o AfterRedo
public virtual AfterRedo()
Redoes the command effects after the transactional redo.
Role: Redefine this method when deriving CATCommandGlobalUndo.
Returns:
An HRESULT. But it is not taken into account. Whatever the method returns, the dialog goes on.
o AfterUndo
public virtual AfterUndo()
Undoes the command effects after the transactional undo.
Role: Redefine this method when deriving CATCommandGlobalUndo.
Returns:
An HRESULT. But it is not taken into account. Whatever the method returns, the dialog goes on.
o BeforeRedo
public virtual BeforeRedo()
Redoes the command effects before the transactional undo.
Role: Redefine this method when deriving CATCommandGlobalUndo.
Returns:
An HRESULT. But it is not taken into account. Whatever the method returns, the dialog goes on.
o BeforeUndo
public virtual BeforeUndo()
Undoes the command effects before the transactional undo.
Role: Redefine this method when deriving CATCommandGlobalUndo.
Returns:
An HRESULT. But it is not taken into account. Whatever the method returns, the dialog goes on.
o SetAfterRedoMeth
public virtual SetAfterRedoMeth( iMeth)
Sets the method to redo the command effects after the transactional redo.
Parameters:
iMeth
The method which redoes the command effects. It must be a command's static method because the command is deleted after its completion.
o SetAfterUndoMeth
public virtual SetAfterUndoMeth( iMeth)
Sets the method to undo the command effects after the transactional undo.
Parameters:
iMeth
The method which undoes the command effects. It must be a command's static method because the command is deleted after its completion.
o SetBeforeRedoMeth
public virtual SetBeforeRedoMeth( iMeth)
Sets the method to redo the command effects before the transactional redo.
Parameters:
iMeth
The method which redoes the command effects. It must be a command's static method because the command is deleted after its completion.
o SetBeforeUndoMeth
public virtual SetBeforeUndoMeth( iMeth)
Sets the method to undo the command effects before the transactional undo.
Parameters:
iMeth
The method which undoes the command effects. It must be a command's static method because the command is deleted after its completion.
o SetData
public virtual SetData( iData)
Sets data which may be useful to undo/redo the command effects.
Role: This data will be given as the argument of the CATGlobalUndoMethod methods.
Parameters:
iData
An object that can be useful for the command undo and redo methods.
Cyclic reference: A copy of iData is kept. This object will be deallocated by the method given by the
method.
o SetDeallocateMeth
public virtual SetDeallocateMeth( iMeth)
Sets the method to deallocate the data given with the SetData method.
Parameters:
iMeth
The method which deallocates the data. It must be a command's static method because the command is deleted after its completion.

This object is included in the file: CATCommandGlobalUndo.h
If needed, your Imakefile.mk should include the module: JS0FM

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.