3D PLM Enterprise Architecture |
User Interface - Dialogs |
CATDlgCheckItemSelects one or several inclusive options |
Quick Reference |
CATDialog | +---CATDlgMenuItem | +---CATDlgCheckItem
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.
Name | Description |
---|---|
default | The default check item style. |
Notification | Method | Sent when |
---|---|---|
CATDlgChkIModifyNotification | GetChkIModifyNotification |
Whenever the check item is checked or unchecked |
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
.
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]
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]
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]
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]
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.