All Frameworks Class Hierarchy This Framework Previous Next Indexes
MechanicalModelerUI Class CATPrtPanelStateCmd
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---System.CATEventSubscriber
|
+---System.CATCommand
|
+---DialogEngine.CATDialogAgent
|
+---DialogEngine.CATStateCommand
|
+---MechanicalModelerUI.CATMMUIStateCommand
|
+---MechanicalModelerUI.CATMMUIPanelStateCmd
|
+---CATPrtPanelStateCmd
Usage: you can derive this class.
public class CATPrtPanelStateCmd
Basic class for creation and edition commands with a dialog box in Part Design context.
Role: Derives this class to implement your command.
The data members to create are:
- CATMMUIStateCommand._MyFeature : The feature modified or created during the command. This data will be returned by the
CATMMUIStateCommand.GiveMyFeature method.
- A dialog box to display parameters of the feature. The recommended styles for this dialog box are:
- CATDlgWndBtnOKCancel: OK and Cancel Buttons
- CATDlgWndBtnOKCancelPreview: Ok, Cancel and Preview Buttons
The main methods to override are:
Constructor and Destructor Index
- o
CATPrtPanelStateCmd(CATString&,CATDlgEngBehavior,CATCommandMode,int,CATPathElement*,CATPathElement*)
- Constructs a panel state command.
- o
~CATPrtPanelStateCmd()
-
Method Index
- o
BuildGraph()
- Builds the command state chart.
- o
Cancel(CATCommand*,CATNotification*)
- Cancels the command.
- o
CancelAction(void*)
- Deals with Cancel or Close button click events.
- o
OkAction(void*)
- Deals with Ok button click event.
- o
PreviewAction(void*)
- Deals with Preview button click event.
- o
UpdateKOAction(void*)
- Deals a wrong update after OK.
- o
UpdateOKAction(void*)
- Deals a good update after OK.
Constructor and Destructor
o CATPrtPanelStateCmd
-
Constructs a panel state command.
- Parameters:
-
- iName
- The identifier of the command.
- iBehavior
- The recommended style is CATDlgEngOneShot
- iFocusMode
- 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.
- iCommandMode
- Legal values:
- 1: Default value, the command is in creation mode
- 0:The command is in edition mode
- iWorkingPath
- Sets the default value.
- iActiveObjectPath
- Sets the default value.
o ~CATPrtPanelStateCmd
public virtual ~CATPrtPanelStateCmd( | ) |
-
Methods
o BuildGraph
public virtual void BuildGraph( | ) |
-
Builds the command state chart.
Role: This method constructs the state chart with states, agents and transitions.
To associate the dialog box with a state, create this state by:
Caution: your state chart must have only one state associated with the dialog box returned
by the
CATMMUIPanelStateCmd.GiveMyPanel .
From this specific state, named PanelState for example,
some transitions are automatically defined:
- From the PanelState state to the Update state:
The Update state is defined by the CATMMUIStateCommand class.
- Condition: The end user pushes the Ok Button
- Action Method:
OkAction
- From the PanelState state to the Cancel state:
The Cancel state is defined by the CATStateCommand class.
- Condition: if the end user pushes the Cancel or the Close Buttons
- Action Method:
CancelAction
- From the PanelState state to the PanelState state:
- Condition: if the end user pushes the Preview Button
- Action Method:
PreviewAction
- From Update state to the PanelState state
- From Update state to the NULL state:
- See also:
- CATStateCommand.BuildGraph
o Cancel
-
Cancels the command.
Role:Called when the command selector gives the focus to an exclusive command,
or if this command completes. In this latter case, the focus is given to
the default command (usually Select).
You should not take care of the command destruction. This is done
by the dialog state command engine.
If you override this method, call at the end the current method.
- Parameters:
-
- iCmd
- The command that requests to cancel the current one
- iNotif
- The notification sent
o CancelAction
public virtual CATBoolean CancelAction( | void* | iUseless) |
-
Deals with Cancel or Close button click events.
Role:Action method sets on a transaction between the state created
by the
CATMMUIPanelStateCmd.GetInitialPanelState and the Cancel state (defined in the
CATStateCommand class).
Override this function to customize the actions on the Cancel or Close button click events, and at the end
of the method, call the current method.
- Parameters:
-
- iUseless
- There is no data as argument of this
ActionMethod method.
o OkAction
public virtual CATBoolean OkAction( | void* | iUseless) |
-
Deals with Ok button click event.
Role:Action method sets on the transaction between the state created
by the
CATMMUIPanelStateCmd.GetInitialPanelState and an internal Update state.
Override this function to customize the actions on the OK button click event, and at the end
of the method, call the current method.
- Parameters:
-
- iUseless
- There is no data as argument of the
ActionMethod methods.
o PreviewAction
public virtual CATBoolean PreviewAction( | void* | iUseless) |
-
Deals with Preview button click event.
Role:Action method sets on the loop transaction between the state created
by the
CATMMUIPanelStateCmd.GetInitialPanelState.
Override this function to customize the actions on the Preview button click event, and at the end
of the method, call the current method.
- Parameters:
-
- iUseless
- There is no data as argument of this
ActionMethod method.
o UpdateKOAction
public virtual CATBoolean UpdateKOAction( | void* | iUseless) |
-
Deals a wrong update after OK.
Role:When the end user has pushed the Ok Button, the state chart goes to
the internal Update state. At this moment two possible cases. The update called on
the feature returned by
CATMMUIStateCommand.GiveMyFeature method is:
- OK: The state chart goes to the NULL state, the command is ended. The action method sets
on this transition is UpdateOKAction
- KO: The state chart returns to the
CATMMUIPanelStateCmd.GetInitialPanelState state. The action method sets on this transition is UpdateKOAction
Override this function to customize the actions when the update is KO and at the end
of the method, call the current method.
- Parameters:
-
- iUseless
- There is no data as argument of this
ActionMethod method.
o UpdateOKAction
public virtual CATBoolean UpdateOKAction( | void* | iUseless) |
-
Deals a good update after OK.
Role:When the end user has pushed the Ok Button, the state chart goes to
the internal Update state. At this moment two possible cases. The update called on
the feature returned by
CATMMUIStateCommand.GiveMyFeature method is:
- OK: The state chart goes to the NULL state, the command is ended. The action method sets
on this transition is UpdateOKAction
- KO: The state chart returns to the
CATMMUIPanelStateCmd.GetInitialPanelState state. The action method sets on this transition is UpdateKOAction
Override this function to customize the actions when the update is OK and at the end
of the method, call the current method.
- Parameters:
-
- iUseless
- There is no data as argument of this
ActionMethod method.
This object is included in the file: CATPrtPanelStateCmd.h
If needed, your Imakefile.mk should include the module: CATMechanicalModelerUI