DialogEngine CATDiaAction

Usage: you can derive this class.


public class CATDiaAction

Base class to create a command action.
Role: An action is a task without interaction with the end user. An action may be

Moreover, a CATDiaAction object manages the action undo/redo. But, it must only undo/redo not transactional objects, that is to say the objects which don't belong to a model which implements the CATIUndoTransaction interface, because such a model undoes and redoes its objects itself.
To create an action, you can derive this class and override the methods: or use the method and give as arguments the addresses of methods to execute the action.
Actions must be created in the method.
See also:
,


Constructor and Destructor Index


o CATDiaAction(CATString&)
Constructs an action.
o ~CATDiaAction()

Method Index


o AfterRedo(void*)
Redoes the action effects after the transactional redo.
o AfterUndo(void*)
Undoes the action effects after the transactional undo.
o BeforeRedo(void*)
Redoes the action effects before the transactional redo.
o BeforeUndo(void*)
Undoes the action effects before the transactional undo.
o Do(void*)
Executes the action.
o SetAfterRedoMethod(ActionMethod)
Sets the method to redo the action after the transactional redo.
o SetAfterUndoMethod(ActionMethod)
Sets the method to undo the action after the transactional undo.
o SetBeforeRedoMethod(ActionMethod)
Sets the method to redo the action before the transactional redo.
o SetBeforeUndoMethod(ActionMethod)
Sets the method to undo the action before the transactional undo.
o SetData(void*)
Sets data which may be useful to execute or undo/redo the action.
o SetExecuteMethod(ActionMethod)
Sets the method to execute the action.

Constructor and Destructor


o CATDiaAction
public CATDiaAction( const iName)
Constructs an action.
Role: Use it only when deriving the CATDiaAction class, otherwise use the method to create an action.
Parameters:
iName
The name of the action. May be useful for debug.
o ~CATDiaAction
public virtual ~CATDiaAction()

Methods


o AfterRedo
public virtual AfterRedo( iData=NULL)
Redoes the action effects after the transactional redo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o AfterUndo
public virtual AfterUndo( iData=NULL)
Undoes the action effects after the transactional undo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o BeforeRedo
public virtual BeforeRedo( iData=NULL)
Redoes the action effects before the transactional redo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o BeforeUndo
public virtual BeforeUndo( iData=NULL)
Undoes the action effects before the transactional undo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, if the second action is executed only if the first action returns TRUE.
o Do
public virtual Do( iData=NULL)
Executes the action.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o SetAfterRedoMethod
public virtual SetAfterRedoMethod( iMeth)
Sets the method to redo the action after the transactional redo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetAfterRedoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which redoes the action.
o SetAfterUndoMethod
public virtual SetAfterUndoMethod( iMeth)
Sets the method to undo the action after the transactional undo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetAfterUndoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which undoes the action.
o SetBeforeRedoMethod
public virtual SetBeforeRedoMethod( iMeth)
Sets the method to redo the action before the transactional redo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetBeforeRedoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which redoes the action.
o SetBeforeUndoMethod
public virtual SetBeforeUndoMethod( iMeth)
Sets the method to undo the action before the transactional undo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetBeforeUndoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which undoes the action.
o SetData
public virtual SetData( iData)
Sets data which may be useful to execute or undo/redo the action.
Role: This data will be given as the argument of the ActionMethod methods.
Parameters:
iData
An object that can be useful for the action.
Warning: A copy of iData is kept. Deallocate this object only at the end of the command.
o SetExecuteMethod
public virtual SetExecuteMethod( iMeth)
Sets the method to execute the action.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetExecuteMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which does the action.

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

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