AfrStandard Interface CATIAfrCmdPaletteOptions
Usage: you can freely reimplement this interface.
interface CATIAfrCmdPaletteOptions
Interface for state commands to dynamically fill the Tools Palette.
Role: The Tools Palette is a special toolbar which updates dynamically when:
- Entering a workbench. The workbench implements the interface.
- Executing a command. The command implements this interface.
The Tools Palette contains options.
An option is a command header instance which may start a simple command
(
) ; avoid dialog (
) or state commands (CATStateCommand). Often a check header, encapsulated by the
class, is sufficient.
The
enables you to specify the options available as long as the command is alive,
and the
enables you to specify the options depending on states.
When the command is interrupted by a shared command, all its options become
unavailable.
About the command header instance usage
You may create the header instances at any time before the GetPaletteOptions
or the GetPaletteStateOptions methods are called or even inside these methods.
You have only one rule to respect, a
command header instance must be created only once during the
life. The
global fuction can be used to retrieve a command header instance from its identifier, or to check its existence
before its creation.
Method Index
- o
GetPaletteOptions()
- Gets the options to display when entering the command.
- o
GetPaletteStateOptions()
- Gets the options to display when changing the command current state.
Methods
o GetPaletteOptions
public virtual GetPaletteOptions( | ) |
-
Gets the options to display when entering the command.
Role:This method provides the options available during the
life of the command. But this method is called at the first command activation,
it means that the command must be a shared or exclusive command.
- Returns:
- List of options.
The returned options are added to the Palette when the command
is started and they are automatically removed when leaving the command.
The list can be empty.
o GetPaletteStateOptions
public virtual GetPaletteStateOptions( | ) |
-
Gets the options to display when changing the command current state.
RoleThis method is called when entering a state. In most cases,
the name of the current state should be compared to a string to
return a specific list. Here is an example that you can find in such method:
CATLISTP(CATCommandHeader) PaletteStateOptions;
CATDialogState * pCurrentState = GetCurrentState();
if ( NULL != pCurrentState )
{
CATString StateName = pCurrentState->GetResourceID();
if ( ! strcmp("MyStateId",StateName) )
{
PaletteStateOptions.Append(pCmdHdr);
...
where pCmdHdr can be a command header pointer retrieval by the
global function.
- Returns:
- List of options.
The returned options are added to the Palette for the current state
and they are automatically removed when leaving the state.
The list can be empty for all the states, or for some of them.
If the command is a simple
, return an empty list.
This object is included in the file: CATIAfrCmdPaletteOptions.h
If needed, your Imakefile.mk should include the module: CATAfrPalette
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.