All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

DialogEngine Class CATStateCommand

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---System.CATEventSubscriber
        |
        +---System.CATCommand
          |
          +---DialogEngine.CATDialogAgent
            |
            +---CATStateCommand
 

Usage: you can derive this class.


public class CATStateCommand

Base class for a State Command.
Role: A State Command is a command modeled as a state machine. It is a graph made of states linked between them using incoming and outgoing transitions. The states are composed of dialog agents which let the end user input the requested parameters. Conditions may be associated with states and transitions in order to guide the progression according to the user inputs. Actions are linked to states and transition to execute the know-how of the command.
To create a State Command, derive the CATStateCommand class and override the methods:

if needed to manage the activation cycle and above all in order to build the state chart.

Life cycle

In general, a main State Command is allocated by the command header and is deallocated by the internal focus mechanism.
A main State Command ends when:

Error Management during execution

Exceptions thrown during condition evaluation or action execution must be caught by the condition methods or the action methods.
Nevertheless, if DialogEngine catches one, the main State Command is desactivated while a default error dialog box displays information about the error. Then the main State Command resumes after the error dialog box is closed.

See also:
CATDialogState, CATDialogTransition, CATStateCondition, CATDiaAction, CATDialogAgent


Constructor and Destructor Index


o CATStateCommand(CATString&,CATDlgEngBehavior,CATCommandMode)
Constructs a State Command.
o ~CATStateCommand()

Method Index


o Action(ActionMethod,ActionMethod,ActionMethod,void*)
Creates an action given the addresses of the methods to execute.
o AddCSOClient(CATCommand*)
Declares an agent as a CSO client.
o AddDialogState(CATDialogState*)
Adds an existing state to the command.
o AddDialogState(CATString&)
Creates a state.
o AddLocalUndo(CATCommandGlobalUndo*,CATUnicodeString&,CATDlgEngBehavior)
Adds a local Undo step.
o AddSDOElement(CATBaseUnknown*)
Sets the object in the CATSDO.
o AddTransition(CATDialogState*,CATDialogState*)
Creates a transition given its source and target states.
o AddTransition(CATDialogState*,CATDialogState*,CATStateCondition*,CATDiaAction*)
Creates a transition given its source and target states, its condition and its action.
o AndAction(CATDiaAction*,CATDiaAction*)
Creates a composite action which combines actions using the AND operator.
o AndCondition(CATStateCondition*,CATStateCondition*)
Creates a composite condition which combines conditions using the AND operator.
o BuildGraph()
Builds the command statechart.
o Condition(ConditionMethod,void*)
Creates a condition given the address of a method to execute.
o ExecuteUndoAtEnd()
Requests to undo the State Command when it ends.
o Filter(FilterMethod,void*)
Creates an agent filter given the address of a method to execute.
o GetCancelState()
Creates the cancel state or retrieves it if it already exists.
o GetCurrentState()
Returns the current state.
o GetError()
Returns the error caught by DialogEngine during a condition evaluation or an action execution.
o GetGlobalUndo()
Returns the undo/redo object associated with the command.
o GetInitialState(CATString&)
Creates the initial state or retrieves it if it already exists.
o GetLastModifiedAgent()
Returns the agent which has just been modified.
o GetLastNotification()
Returns the latest notification.
o GetNextState()
Returns the pointed command state and points to the next one.
o GetNextTransition()
Returns the pointed command transition and points to the next one.
o InitStateList()
Points to the first command state.
o InitTransitionList()
Points to the first command transition.
o IsLastModifiedAgent(CATCommand*)
Tests if an agent has just been modified.
o IsLastModifiedAgentCondition(CATCommand*,CATNotification*)
Creates a condition which checks whether an agent is the latest modified agent.
o IsLastModifiedAgentCondition(CATCommand*,char*)
Creates a condition which checks whether an agent is the latest modified agent.
o IsOutputSetCondition(CATCommand*)
Creates a condition which checks whether an agent is valued.
o IsRedoMode()
Tests if a redo is being processed.
o NotCondition(CATStateCondition*)
Creates a composite condition which uses the NOT operator on its subcondition.
o NotCondition(ConditionMethod,void*)
Creates a NOT condition given the address of a method to execute.
o OrAction(CATDiaAction*,CATDiaAction*)
Creates a composite action which combines actions using the OR operator.
o OrCondition(CATStateCondition*,CATStateCondition*)
Creates a composite condition which combines conditions using the OR operator.
o RemoveState(CATDialogState*)
Removes a state from a command.
o RemoveTransition(CATDialogTransition*)
Removes a transition from a command.
o RequestDelayedDestruction()
Requests the state command delayed destruction.
o RequestLocalUndo(int)
Requests to undo local steps in the State Command.
o Rescue()
Cleans data if an error occurs.
o SetDebugMode(CATBoolean)
Sets the debug mode.
o SetErrorCommand(CATCommand*)
Sets a specific command to manage errors.
o SetInitialState(CATDialogState*)
Declares a state as the initial state.

Constructor and Destructor


o CATStateCommand
public CATStateCommand( const CATString& iId,
CATDlgEngBehavior iBehavior=NULL,
CATCommandMode iMode=CATCommandModeExclusive)
Constructs a State Command.
Parameters:
iId
The command identifier. It must be unique and is used to retrieve the undo/redo titles in the command message file.
iBehavior
The behavior of the command.
iMode
The focus mode.
Legal values: With the default mode CATCommandModeExclusive, the command takes the focus and cancels the other commands. This mode is mandatory if the command modifies the model.
The other possible mode is CATCommandModeShared: the command only deactivates the active command and takes the focus. The previous command will resume when the current command ends.
The CATCommandModeUndefined mode is forbidden with a main State Command since it needs to take the focus, but must be used for a State Command used as an agent of another State Command.
o ~CATStateCommand
public virtual ~CATStateCommand()

Methods


o Action
public CATDiaAction * Action(ActionMethod iDo,
ActionMethod iBeforeUndo=NULL,
ActionMethod iBeforeRedo=NULL,
void* iData=NULL)
Creates an action given the addresses of the methods to execute.
Role: These methods must be methods of the current state command.
Parameters:
iDo
The method to execute in the normal mode.
iBeforeUndo
The method to undo what has been done in the iDo method. This method is executed before the transaction undo and must not modify transactional objects.
iBeforeRedo
The method to redo what has been done in the iDo method. This method is executed before the transaction redo and must not modify transactional objects.
iData
An object that can be useful for the action. This data will be given as the argument of the ActionMethod methods.
Warning: A copy of iData is kept. Deallocate this object only in the command destructor.
Returns:
The action.
Cyclic reference: A pointer to the action is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o AddCSOClient
public void AddCSOClient(CATCommand* )
Declares an agent as a CSO client.
Role: At the beginning of the command, CATPathElementAgent agents declared as CSO clients will try to get valued with the CATPathElement objects present in the CSO.
All the objects in the CSO must be used: if an object in the CSO can not be used to value an agent, all the valuations from the CSO are cancelled.
This CSO client mecanism is useful to program object/action commands.
As regards repeating commands, this mechanism only works at the first execution of the command.
Parameters:
iAgent
The agent to be valued from the CSO..
o AddDialogState
public virtual void AddDialogState(CATDialogState* iState)
Adds an existing state to the command.
Role: Use this method only with CATPanelState states. Otherwise, use the AddDialogState method which creates and adds the state in the same time.
Parameters:
iState
The state.
Cyclic reference: A copy of iState is kept, and AddRef'ed. It is Released at the end of the command before the command destructor call.
o AddDialogState
public virtual CATDialogState * AddDialogState( const CATString& iId)
Creates a state.
Parameters:
iId
The resource identifier used to retrieve the state prompt in the command message file.
Returns:
The state.
Cyclic reference: A pointer to the state is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o AddLocalUndo
public void AddLocalUndo(CATCommandGlobalUndo* iUndoObject,
const CATUnicodeString& iUndoTitle,
CATDlgEngBehavior iUndoBehavior=CATDlgEngWithUndoStep)
Adds a local Undo step.
Role: This method adds a local step in the Undo stack.
When a transition is executed as a consequence of an explicit acquisition agent valuation (and not as a consequence of a user action) no Undo step is stacked (whatever the agent's behavior). This method enables you to explicitely add a local Undo step.
Parameters:
iUndoObject
The Undo/Redo step manager for this step. No specific Undo/Redo step manager is requested if there is no specific need (Undo/Redo for features is already managed).
iUndoTitle
The title displayed in the Undo history.
iUndoBehavior
The behavior.
Legal values:
CATDlgEngWithUndoStep: The step is displayed in the Undo history (default).
NULL: Reserved for internal usage.
Example of usage: When a selection is expected, sometimes the user uses a contextual menu to create an element which will be explicitely got as an input for the selection as soon as it is created. This can be done by explicitely valuating an acquisition agent with the CSO content during resume of the main command. By default, the Undo command then undoes both selection and creation of the element. In order to enable the user to undo the selection without undoing the creation of the element, this method can be used to add a local Undo step.
Example of implementation:
    CATPathElementAgent * curPathAgent = ...; 
    if (curPathAgent)
    {
      // create explicit local undo step
      CATCommandGlobalUndo * GlobalUndo = new CATCommandGlobalUndo;
      if (GlobalUndo)
      {
        AddLocalUndo(GlobalUndo,”MyStep”);
        GlobalUndo -> Release(); GlobalUndo = NULL;
      }
      // value curPathAgent
      curPathAgent -> SetValue(...);
      curPathAgent -> SetValuation();
    }
 
o AddSDOElement
public void AddSDOElement(CATBaseUnknown* iObject)
Sets the object in the CATSDO.
Parameters:
iObject
This object is set in the SDO
See also:
CATCommandHeaderWithSDOForAgent
o AddTransition
public virtual CATDialogTransition * AddTransition(CATDialogState* iSource,
CATDialogState* iTarget)
Creates a transition given its source and target states.
Parameters:
iSource
The source state.
Cyclic reference: A copy of iSource is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
iTarget
The target state.
Cyclic reference: A copy of iTarget is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
Legal values: The target state may be NULL to represent the end of the command.
Returns:
The transition.
Cyclic reference: A pointer to the transition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o AddTransition
public virtual CATDialogTransition * AddTransition(CATDialogState* iSource,
CATDialogState* iTarget,
CATStateCondition* iCondition,
CATDiaAction* iAction)
Creates a transition given its source and target states, its condition and its action.
Parameters:
iSource
The source state.
Cyclic reference: A copy of iSource is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
iTarget
The target state.
Cyclic reference: A copy of iTarget is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
Legal values: The target state may be NULL to represent the end of the command.
iCondition
The condition.
Legal values: The condition may be NULL or specified later by the
CATDialogTransition.SetCondition method. A NULL condition evaluates TRUE, so the transition fires at the first agent valuation.
iAction
The action.
Legal values: The action may be NULL or specified later by the
CATDialogTransition.SetAction method.
Returns:
The transition.
Cyclic reference: A pointer to the transition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o AndAction
public CATDiaAction * AndAction(CATDiaAction* iAct1,
CATDiaAction* iAct2)
Creates a composite action which combines actions using the AND operator.
Role: The iAct1 action is executed first. Then the iAct2 action is executed whatever iAct1 returned.
Parameters:
iAct1
The first action to execute.
Cyclic reference: A copy of iAct1 is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
iAct2
The second action to execute.
Cyclic reference: A copy of iAct2is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
Returns:
The composite action.
Cyclic reference: A pointer to the action is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o AndCondition
public CATStateCondition * AndCondition(CATStateCondition* iCond1,
CATStateCondition* iCond2)
Creates a composite condition which combines conditions using the AND operator.
Role: The AND condition returns TRUE if its subconditions return both TRUE. The iCond1 condition is evaluated first. Then the iCond2 condition is evaluated only if iCond1 returned TRUE.
Parameters:
iCond1
The first condition to evaluate.
Cyclic reference: A copy of iCond1 is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
iCond2
The second condition to evaluate.
Cyclic reference: A copy of iCond2 is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
Returns:
The composite condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o BuildGraph
public virtual void BuildGraph()
Builds the command statechart.
Role: Override this method to define the command graph.
o Condition
public CATStateCondition * Condition(ConditionMethod iEvaluate,
void* iData=NULL)
Creates a condition given the address of a method to execute.
Role: This method must be a method of the current State Command.
Parameters:
iEvaluate
The method to execute to evaluate the condition.
iData
An object that can be useful for the condition. This data will be given as the argument of the iEvaluate method.
Warning: A copy of iData is kept. Deallocate this object only in the command destructor.
Returns:
The condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o ExecuteUndoAtEnd
public void ExecuteUndoAtEnd()
Requests to undo the State Command when it ends.
Role: This method can be used: It requests a global undo at the end of the State Command.
Note: It is recommended to use transitions towards the Cancel state rather than using this method.
o Filter
public CATAcquisitionFilter * Filter(FilterMethod iMeth,
void* iData)
Creates an agent filter given the address of a method to execute.
Role: This method must be a method of the current State Command.
Parameters:
iMeth
The method to filter the agent value.
iData
An object that can be useful for the filter. This data will be given as the argument of the iMeth method.
Warning: A copy of iData is kept. Deallocate this object only in the command destructor.
Returns:
The filter.
Cyclic reference: A pointer to the filter is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value. See also: CATDialogAgent.AndFilter, CATDialogAgent.OrFilter and CATDialogAgent.NotFilter methods.
o GetCancelState
public virtual CATDialogState * GetCancelState()
Creates the cancel state or retrieves it if it already exists.
Role: When the dialog reaches the cancel state, the command ends as if it had reached the NULL state, and a global undo is executed.
Returns:
The cancel state.
Cyclic reference: A pointer to the state is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o GetCurrentState
public virtual CATDialogState * GetCurrentState()const
Returns the current state.
Role: In a transition action, the current state is the source state of the transition.
Returns:
The current state.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o GetError
public CATDiaError * GetError()
Returns the error caught by DialogEngine during a condition evaluation or an action execution.
Role: This method can be used in the Rescue method or in the command which is in charge of the error management to get information about the error.
Returns:
The error.
o GetGlobalUndo
public virtual CATCommandGlobalUndo * GetGlobalUndo()
Returns the undo/redo object associated with the command.
Role: This method returns an object with methods to execute when the command is undone or redone.
Returns:
The undo/redo object.
o GetInitialState
public virtual CATDialogState * GetInitialState( const CATString& iId)
Creates the initial state or retrieves it if it already exists.
Role: The initial state is the state with which the command starts. There is only one initial state.
Parameters:
iId
The resource identifier used to retrieve the state prompt in the command message file. This identifier is useful only if the initial state doesn't already exist.
Returns:
The initial state.
Cyclic reference: A pointer to the state is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o GetLastModifiedAgent
public virtual CATCommand * GetLastModifiedAgent()const
Returns the agent which has just been modified.
Returns:
The agent.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o GetLastNotification
public virtual CATNotification * GetLastNotification()const
Returns the latest notification.
Role: This method only works just after the notification reception. So it cannot be used in undo/redo methods.
Returns:
The notification.
o GetNextState
public virtual CATDialogState * GetNextState()
Returns the pointed command state and points to the next one.
Precondition: Set the pointer to the first command state using InitStateList before traversing out the command state list using calls to GetNextState enclosed in a loop.
Returns:
The pointed state.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o GetNextTransition
public virtual CATDialogTransition * GetNextTransition()
Returns the pointed command transition and points to the next one.
Precondition: Set the pointer to the first command transition using InitTransitionList before traversing out the command transition list using calls to GetNextTransition enclosed in a loop.
Returns:
The pointed transition.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o InitStateList
public virtual void InitStateList()
Points to the first command state.
See also:
GetNextState
o InitTransitionList
public virtual void InitTransitionList()
Points to the first command transition.
See also:
GetNextTransition
o IsLastModifiedAgent
public virtual CATBoolean IsLastModifiedAgent(CATCommand* iAgent) const
Tests if an agent has just been modified.
Parameters:
iAgent
The agent.
Returns:
The result of the test.
o IsLastModifiedAgentCondition
public CATStateCondition * IsLastModifiedAgentCondition(CATCommand* iAgent,
CATNotification* iNotif=NULL)
Creates a condition which checks whether an agent is the latest modified agent.
Role: The condition evaluates TRUE if the iAgent agent has just been modified and if it was due to the iNotif notification.
Parameters:
iAgent
The agent.
iNotif
The address of a notification.
Legal values: It can be NULL: the condition only checks if the iAgent agent has just been modified.
Returns:
The condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o IsLastModifiedAgentCondition
public CATStateCondition * IsLastModifiedAgentCondition(CATCommand* iAgent,
const char* iNotifClass)
Creates a condition which checks whether an agent is the latest modified agent.
Role: The condition evaluates TRUE if the iAgent agent has just been modified and if it was due to a notification which belongs to the iNotifClass class.
Parameters:
iAgent
The agent.
iNotifClass
The notification class.
Legal values: It can be NULL: the condition only checks if the iAgent agent has just been modified.
Returns:
The condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o IsOutputSetCondition
public CATStateCondition * IsOutputSetCondition(CATCommand* iAgent)
Creates a condition which checks whether an agent is valued.
Role: The condition evaluates TRUE if the iAgent agent is valued.
Parameters:
iAgent
The agent.
Returns:
The condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o IsRedoMode
public virtual int IsRedoMode()const
Tests if a redo is being processed.
Role: It may be useful if a method is used as a Do and a Redo method, to avoid modifying transactional objects in Redo mode.
Returns:
The result of the test.
Legal values:1 in redo mode, 0 in normal or undo mode.
o NotCondition
public CATStateCondition * NotCondition(CATStateCondition* iCond)
Creates a composite condition which uses the NOT operator on its subcondition.
Role: The NOT condition returns TRUE if its subcondition returns FALSE.
Parameters:
iCond
The subcondition.
Cyclic reference: A copy of iCond is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
Returns:
The composite condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o NotCondition
public CATStateCondition * NotCondition(ConditionMethod iEvaluate,
void* iData=NULL)
Creates a NOT condition given the address of a method to execute.
Role: This method must be a method of the current State Command.
The condition returns TRUE if the method returns FALSE.
Parameters:
iEvaluate
The method to execute to evaluate the condition. This method gives a result opposite to the condition result.
iData
An object that can be useful for the condition. This data will be given as the argument of the iEvaluate method.
Warning: A copy of iData is kept. Deallocate this object only in the command destructor.
Returns:
The condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o OrAction
public CATDiaAction * OrAction(CATDiaAction* iAct1,
CATDiaAction* iAct2)
Creates a composite action which combines actions using the OR operator.
Role: The iAct1 action is executed first. Then the iAct2 action is executed only if iAct1 returned TRUE.
Parameters:
iAct1
The first action to execute.
Cyclic reference: A copy of iAct1 is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
iAct2
The second action to execute.
Cyclic reference: A copy of iAct2 is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
Returns:
The composite action.
Cyclic reference: A pointer to the action is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o OrCondition
public CATStateCondition * OrCondition(CATStateCondition* iCond1,
CATStateCondition* iCond2)
Creates a composite condition which combines conditions using the OR operator.
Role: The OR condition returns TRUE if one of its subconditions returns TRUE. The iCond1 condition is evaluated first. Then the iCond2 condition is evaluated only if iCond1 returned FALSE.
Parameters:
iCond1
The first condition to evaluate.
Cyclic reference: A copy of iCond1 is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
iCond2
The second condition to evaluate.
Cyclic reference: A copy of iCond2 is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.
Returns:
The composite condition.
Cyclic reference: A pointer to the condition is kept and Released at the end of the command before the command destructor call.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
o RemoveState
public virtual int RemoveState(CATDialogState* iState)
Removes a state from a command.
Role: May be useful if you need to modify a graph inherited from the base class but don't use it dynamically during the dialog.
This state must not be linked to a transition (the transition must be removed first) and must not be the cancel state nor the initial state.
Parameters:
iState
The state to remove.
Returns:
The error return code.
Legal values:
  • 0: the state is removed successfully.
  • 1: the state is not found.
  • 2: the remove operation failed because the state is still useful. (it is the initial or the cancel state or it is linked to a transition.
o RemoveTransition
public virtual int RemoveTransition(CATDialogTransition* iTrans)
Removes a transition from a command.
Role: May be useful if you need to modify a graph inherited from the base class but don't use it dynamically during the dialog.
Parameters:
iTrans
The transition to remove.
Returns:
The error return code.
Legal values:
  • 0: the transition is removed successfully.
  • 1: the transition is not found.
o RequestDelayedDestruction
public virtual void RequestDelayedDestruction()
Requests the state command delayed destruction.
Role: The state command will be destroyed as soon as this will be possible. This must be used only when the state command is used as an agent of another state command, in this state command's destructor. This must not be used inside a state command to stop its execution.
o RequestLocalUndo
public void RequestLocalUndo(int iCount=1)
Requests to undo local steps in the State Command.
Role: This method can be used: It requests to undo local steps at the end of the transition.
Parameters:
iCount
The number of local Undos to execute.
Legal values: from one (default) to the number of local undos for the State Command.
o Rescue
public virtual void Rescue()
Cleans data if an error occurs.
Role: Override this method to clean data after the default error dialog box is closed.
Warning: If the SetErrorCommand method is used, it is useless to override this method.
o SetDebugMode
public void SetDebugMode(CATBoolean iMode)
Sets the debug mode.
Role: Activates or desactivates the State Command debug trace mode.
When activated, information about the command and its components is displayed in the standard output at different steps of its life cycle.
Parameters:
iMode
Legal values:
FALSE :The trace mode is not activated.
TRUE :The trace mode is activated.
o SetErrorCommand
public void SetErrorCommand(CATCommand* iCmd)
Sets a specific command to manage errors.
Role: This command replaces the default error dialog box displayed when an exception is caught during a condition evaluation or an action execution.
It must be instantiated with the CATCommandModeUndefined mode in the BuildGraph method of the main State Command, and the error treatment must be done in the overridden CATCommand.Activate method.
When an exception occurs, DialogEngine requires a shared focus for this command and after the error treatment the State Command resumes.
See also:
CATCommand
Parameters:
iCmd
The command.
Warning: A pointer to the error command is kept without being AddRef'ed. Deallocate this command only at the end of the main State Command.
o SetInitialState
public virtual void SetInitialState(CATDialogState* iState)
Declares a state as the initial state.
Role: May be useful if you need to modify a graph inherited from the base class but don't use it dynamically during the dialog. It replaces the previous initial state but this former state still belongs to the graph.
Parameters:
iState
The new initial state.
Cyclic reference: A copy of iState is kept and AddRef'ed. It is Released at the end of the command before the command destructor call.

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

Copyright © 2003, Dassault Systèmes. All rights reserved.