CATMecModUIExtendItf CATMmrPrtPanelStateCmd
Usage: you can derive this class.
public class CATMmrPrtPanelStateCmd
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:
- : The feature modified or created during the command. This data will be returned by the
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:
-
: Constructs the state chart
-
: it returns the dialog box created by your command.
-
: to customize the actions on the OK click button events.
-
: to customize the actions on the Preview click button events.
-
: to customize the actions on the Cancel or the Close click button events.
Constructor and Destructor Index
- o
CATMmrPrtPanelStateCmd(CATString&,CATDlgEngBehavior,CATCommandMode,int,CATPathElement*,CATPathElement*)
- Constructs a panel state command.
- o
~CATMmrPrtPanelStateCmd()
-
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 CATMmrPrtPanelStateCmd
public CATMmrPrtPanelStateCmd( | const | iName, |
| | iBehavior | = NULL, |
| | iFocusMode | = CATCommandModeExclusive, |
| | iCommandMode | = 0, |
| const | iWorkingPath | = 0, |
| const | iActiveObjectPath | = 0) |
-
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 ~CATMmrPrtPanelStateCmd
public virtual ~CATMmrPrtPanelStateCmd( | ) |
-
Methods
o BuildGraph
public virtual 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:
-
, if the state is the initial state
-
, otherwise
Caution: your state chart must have only one state associated with the dialog box returned
by the
.
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:
- 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:
- From the PanelState state to the PanelState state:
- Condition: if the end user pushes the Preview Button
- Action Method:
- From Update state to the PanelState state
- Condition: The update applied to the feature
returned by the
method is wrong
- Action Method:
- From Update state to the NULL state:
- Condition: The update applied to the feature
returned by the
method is OK
- Action Method:
- See also:
-
o Cancel
public virtual Cancel( | | iCmd, |
| | iNotif) |
-
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 CancelAction( | | iUseless) |
-
Deals with Cancel or Close button click events.
Role:Action method sets on a transaction between the state created
by the
and the Cancel state (defined in the
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 OkAction( | | iUseless) |
-
Deals with Ok button click event.
Role:Action method sets on the transaction between the state created
by the
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 PreviewAction( | | iUseless) |
-
Deals with Preview button click event.
Role:Action method sets on the loop transaction between the state created
by the
.
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 UpdateKOAction( | | 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
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
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 UpdateOKAction( | | 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
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
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: CATMmrPrtPanelStateCmd.h
If needed, your Imakefile.mk should include the module: CATMecModUIExtendItf
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.