3D PLM Enterprise Architecture |
User Interface - Dialogs |
CATDlgControlBase class for controls |
Quick Reference |
CATDialog | +---CATDlgControl
CATDlgControl is the base class for all controls:
and for the indicators:
The parent of an instance of a class that derives from CATDlgControl must be an instance of a class that derives from CATDlgDocument, CATDlgDialog CATDlgBox, and CATDlgToolBar. Some controls can have a CATDlgStatusBar or a CATDlgIconBox as parent. |
A CATDlgControl instance can be constructed as the base class of one of its derived class only.
[Top]
CATDlgControl centralizes the unit management shared by the controls that can accept a numerical value. These controls are instances of the classes CATDlgCombo, CATDlgEditor, and CATDlgSpinner. Magnitude and unit management is described in Managing Magnitudes and Units. It also gives the list of magnitudes and units available, and the parameters to declare them.
With a combo, and editor, or a spinner, you can manage magnitudes and units as follows. The examples use a pointer to a combo, but it could be a pointer to an editor or a spinner:
get magnitude |
... CATDlgCombo * pCombo; pCombo = new CATDlgCombo(pParent, "ComboId", CATDlgCmdDouble|CATDlgCmbEntry); CATDlgControl::CATDlgMagnitude = ComboMagnitude; ComboMagnitude = pCombo->GetMagnitude(); ... |
set magnitude |
... pCombo->SetMagnitude(CATDlgControl::Pressure); ... |
You cannot choose the unit. This means that once you have set the magnitude using SetMagnitude, you cannot set the unit using SetUnit. It is the unit set at the application level. If no unit is set for the application, the SI system is used, and pressure values are expressed in Pascal (or N/m2).
get unit |
... CATDlgControl::CATDlgUnit = ComboUnit; ComboUnit = pCombo->GetUnit(); ... |
get unit |
... pCombo->SetUnit(CATDlgControl::SquareInch); ... |
You cannot choose the magnitude beforehand. It is set by the unit you choose.
get precision |
... int ComboPrecision = pCombo->GetPrecision(); ... |
set precision |
... pCombo->SetPrecision(8); ... |
For example, the four editors shown beside have their precisions set to 1, 4, 8, and 12 respectively, and all display the same length value of 10,160,151.13 mm. |
[Top]
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.