3D PLM Enterprise Architecture

User Interface - Dialogs

CATDlgCheckItem

Selects one or several inclusive options
Quick Reference

CATDialog
  |
  +---CATDlgMenuItem
        |
        +---CATDlgCheckItem

The Check Item
CATDlgCheckItem.jpg (2695 bytes) Each item beside is a check item instance. They can be found in a menu, a submenu, a toolbar, or an icon box. The check items 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 items Geometry and Compass checked, and Specifications unchecked. The checked state is depicted by the specific check sign in front of the check item name. This can vary depending on the platform and on the CATIA User Interface Style used.

Use check items 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, in a menu, a submenu, a toolbar, or an icon box.


Styles
Name Description
default The default check item style.

Events
Notification Method Sent when
CATDlgChkIModifyNotification GetChkIModifyNotification Whenever the check item is checked or unchecked

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.

Constructing a Check Item

The push item should have for parent either the menu, submenu, toolbar, or icon box in which it appears::

_pCheckItem = new CATDlgCheckItem(_iParent, iName);

[Top]

Setting a Callback on a Check Item

Set a callback on a check button as follows:

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

[Top]

Retrieving or Setting the State of a Check Item

If required, you can retrieve the state of the check item 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           * iCheckItem,
                     CATNotification      * iNotification,
                     CATCommandClientData   iUsefulData)
{
  if (iCheckItem->GetState() == CATDlgCheck) // check item is checked
  { // Do what's required when the check item is checked }
  else                                         // check item is unchecked
  { // Do what's required when the check item is unchecked }
}

You can set the state of a state item 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 Title to a Check Item

The check item 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.