3D PLM Enterprise Architecture

User Interface - Dialogs

CATDlgCheckButton

Selects one or several inclusive options
Quick Reference

CATDialog
  |
  +---CATDlgControl
        |
        +---CATDlgCheckButton

The Check Button
CATDlgCheckButton.gif (2922 bytes)

Each square and related title is a check button instance. The check buttons allow for selecting several options among all the options proposed, that is several can be checked while the others are unchecked. For example, the figure beside shows the two checked buttons Resources and Items checked, and Attributes unchecked. The checked state is depicted by the specific color and shading. This can vary depending on the platform and on the CATIA User Interface Style used.

Use check buttons whenever you propose to the end user a choice among several inclusive options, that is when several options can be selected at the same time.


Styles
Name Description
default The title is placed at the right of the button

Events
Notification Method Sent when
CATDlgChkBModifyNotification GetChkBModifyNotification Whenever the check button is checked or unchecked
CATDlgChkBDoubleClickNotification GetChkBDoubleClickNotification Whenever the check button is double clicked. The expected behavior is to loop on the associated command

Programmer's Guide

The check button is dedicated to selecting one or several options among those available. Each button is a CATDlgCheckButton instance and can be represented as a cell to check or with an icon, the text being always placed on the right.

A notification is sent whenever the user presses a check button. This notification can be retrieved using the method GetChkBModifyNotification. The check button state can be CATDlgCheck when it is checked, and CATDlgUncheck when it is not. You can have to test this state using the method GetState, or to set it using the method SetState.

[Top]

Constructing a Check Button

A check button has no style parameter. Construct it as follows:

_pCheckButton = new CATDlgCheckButton(_iParent, iName);

[Top]

Retrieving or Setting the State of a Check Button

If required, you can retrieve the state of the check button with the method GetState to determine if the user has checked or unchecked it. This is often useful in the method to execute from a callback:

void MethodToExecute(CATCommand           * iCheckButton,
                     CATNotification      * iNotification,
                     CATCommandClientData   iUsefulData)
{
  if (iCheckButton->GetState() == CATDlgCheck) // check button is checked
  { // Do what's required when the check button is checked }
  else                                         // check button is unchecked
  { // Do what's required when the check button is unchecked }
}

You can set the state of a state button with the SetState method:

int iNotify = 1;
_pCheckButton->SetState(CATDlgUncheck, iNotify);

Set the first parameter to the state you require, and the parameter iNotify to a non null value if you want that the corresponding notification is sent. Otherwise set to 0, no notification is sent.

[Top]

Setting a Callback on a Check Button

Set a callback on a check button as follows:

AddAnalyseNotificationCB(
  _pCheckButton,                                // check button 
  _pCheckButton->GetChkBModifyNotification(),   // notification
  (CATCommand)&Container::MethodToExecute,      // method to execute 
  CATCommandClientData iUsefulData);            // useful data for this method 

[Top]

Setting a Title to a Check Button

The check button title should be set by the resource file using a key built with the identifier you declare as the second parameter of the check button constructor.

[Top]


History

Version: 1 [Jan 2000] Document created
[Top]

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