All Frameworks  Class Hierarchy  This Framework  Next  Indexes

ApplicationFrame Class CATAfrCheckHeaderAccessor

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---CATAfrCheckHeaderAccessor
 

Usage: you must use this class as is. You should never derive it.


public class CATAfrCheckHeaderAccessor

Class to handle a check header.
Role: A check header is a CATCommandHeader which is represented in a toolbar or in the menu bar as a check button. The CATAfrCheckHeaderAccessor class encapsulates the creation and the access to a check header instance. The class identifier (the argument of the constructor) is also the check header identifier.

How to use this class ?

A CATAfrCheckHeaderAccessor class instantiation creates a check header instance only if the instance does not already exist in the command header list of the current CATFrmEditor.
Each time you need an access on a check header instance, create an instance of the CATAfrCheckHeaderAccessor class, use its methods to modify or retrieve information on the check header instance, and then release the class instance.

How to specify the check/uncheck behaviors ?

A check header has two states: check and uncheck. Specific behaviors are associated to its two states by the means of two other CATCommandHeader instances. One will be started whether the check button turns to the "checked" state ( SetCheckCommand ) and the other will be started whether the check button turns to the "unchecked" state ( SetUncheckCommand ). The behaviors are implemented in the commands called by these two command headers.

However, the check/uncheck behaviors are not mandatory. You can create a check header only to have a header keeping a two position state. In this case, except the mandatory methods such as the constructor and SetResourceFile, only the IsChecked and the SetCheck methods are really important.


Constructor and Destructor Index


o CATAfrCheckHeaderAccessor(CATString&)
Constructs a CATAfrCheckHeaderAccessor.
o ~CATAfrCheckHeaderAccessor()

Method Index


o GetCheckCommand()
Returns the command header identifier associated to the "check" state.
o GetResourceFile()
Returns the resource file name associated to the check header.
o GetUncheckCommand()
Returns the command header identifier associated to the "uncheck" state.
o IsChecked()
Returns the check button state.
o SetCheck(CATBoolean,CATBoolean)
Sets the state of the check button.
o SetCheckCommand(CATString&)
Associates a command header to the "check" state.
o SetResourceFile(CATString&)
Associates a resource file name to the check header.
o SetUncheckCommand(CATString&)
Associates a command header to the "uncheck" state.

Constructor and Destructor


o CATAfrCheckHeaderAccessor
public CATAfrCheckHeaderAccessor( const CATString& iCheckHeaderIdentifier)
Constructs a CATAfrCheckHeaderAccessor.
Role:This method creates, if it does not already exist, a check header instance whose the name is iChechHeaderIdentifier. The check header instance pointer can be retrieved, as a @CATCommandHeader class instance, thanks to the CATAfrGetCommandHeader global function.
Parameters:
iCheckHeaderIdentifier
Identifier for the check header instance.
o ~CATAfrCheckHeaderAccessor
public virtual ~CATAfrCheckHeaderAccessor()

Methods


o GetCheckCommand
public CATString & GetCheckCommand()
Returns the command header identifier associated to the "check" state.
Returns:
Identifier of the header.
o GetResourceFile
public CATString GetResourceFile()
Returns the resource file name associated to the check header.
Returns:
Name of the resource file.
o GetUncheckCommand
public CATString & GetUncheckCommand()
Returns the command header identifier associated to the "uncheck" state.
Returns:
Identifier of the header.
o IsChecked
public CATBoolean IsChecked()
Returns the check button state.
Returns:
FALSE for the unchecked state and TRUE for the checked state.
o SetCheck
public void SetCheck(CATBoolean iChecked=TRUE,
CATBoolean iStartCmd=TRUE)
Sets the state of the check button.
Parameters:
iChecked
TRUE checks the buttons, FALSE unchecks it.
iStartCmd
TRUE starts the command corresponding to the new state, FALSE does not start the command.
o SetCheckCommand
public void SetCheckCommand( const CATString& iChkCmdName)
Associates a command header to the "check" state.
Role:The given command header will be started each time the check button is checked.
Parameters:
iChkCmdName
Identifier of the header.
o SetResourceFile
public void SetResourceFile( const CATString& iFileName)
Associates a resource file name to the check header.
Role: This method enables you to associate NLS resources to the check header instance.
Parameters:
iFileName
Name of the resource file.
o SetUncheckCommand
public void SetUncheckCommand( const CATString& iUchkCmdName)
Associates a command header to the "uncheck" state.
Role: The given command header will be started each time the check button is unchecked.
Parameters:
iUchkCmdName
Identifier of the header.

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

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