3D PLM Enterprise Architecture |
User Interface - Dialogs |
CATDialogBase class for all dialog classes |
Quick Reference |
CATDialog is the base class for all dialog object classes and implements their common mechanisms. All the tasks described here consequently apply to any dialog object instance.
Notification | Method | Sent when |
---|---|---|
CATDlgCreateNotification | GetCreateNotification |
When the object is created |
CATDlgVisibilityNotification | GetVisibilityNotification |
Whenever the object visibility is modified |
CATDlgResizeNotification | GetResizeNotification |
Whenever the object is resized |
CATDlgHelpNotification | GetHelpNotification |
Whenever the object is selected using the What's This command |
CATDlgDragEnterNotification | GetDragEnterNotification |
Whenever the mouse is dragged and enters the dialog object |
CATDlgDragOverNotification | GetDragOverNotification |
Whenever the mouse is being dragged over the dialog object |
CATDlgDragLeaveNotification | GetDragLeaveNotification |
Whenever the mouse is dragged and leaves the dialog object |
CATDlgDropNotification | GetDropNotification |
Whenever a drop occurs on the dialog object |
CATDlgEndDropNotification | GetEndDropNotification |
Whenever a drop occurs on the dialog object |
CATDlgStartDragNotification | GetStartDragNotification |
Whenever a mouse drag starts on the dialog object |
CATDlgCancelDragNotification | GetCancelDragNotification |
Whenever a mouse drag stops on the dialog object |
CATDlgDragButtonNotification | GetDragButtonNotification |
Whenever a mouse drag starts on a button of the dialog object |
[Top]
Three static tables contains:
KeyName
: the accelerator namesMagnitudeName
: the magnitudes [1]
that you can set for the figures entered or displayed using combos, editors,
and spinners, and that are expressed with the unit assigned to these
magnitudes at the applicaiton levelUnitName
: the units [1] associated
with these magnitudes that you can reset for a given combo, editor, or
spinner.The programming tasks fall into the following topics:
[Top]
Any dialog object has two parent/child links:
Usually, the same dialog object is the parent for these two parent/child link, since any dialog object that can contain others is also a CATCommand instance. Nevertheless, it can be efficient to sometimes have two different parent objects.
A given dialog object can be the containing parent of several others. Use the
GetChildCount
method to determine how many children exist.
int ChildrenCount = pDialog->GetChildCount(); |
Use the GetChildNumberFromChild
method to retrieve the rank of a
given child dialog object among all the children of a dialog object.
int ChildNumber = pDialog->GetChildNumberFromChild(pChild ); |
Use the GetChildFromChildNumber
method to retrieve a child
dialog object from its rank.
CATDialog * pChild = pDialog->GetChildFromChildNumber(nChild); |
[Top]
Use the GetFatherWindow
method to retrieve the dialog window
that contains the dialog object.
CATDlgWindow * pContainingWindow = pDialog->GetFatherWindow(); |
[Top]
Use the ReParent
method to change the dialog containment parent.
int Succeeded = pDialog->Reparent(pNewParent); |
pNewParent
can be a CATDlgBox or a CATDlgWindow instance only,
since it must contain pDialog
.
Use the CATCommand SetFather
method to change the CATCommand
send/receive parent.
pDialog->SetFather(pNewParent); |
pNewParent
must be a CATCommand instance to be able to receive
the notifications sent by pDialog
. This is the case of all dialog
objects.
[Top]
The dialog object properties are its visibility, its sensitivity to end user interaction, its style.
[Top]
Use the SetVisibility
and GetVisibility
methods
with the parameters CATDlgShow
and CATDlgHide
to
manage the visibility of a dialog object.
set visibility |
CATULong ObjectVisibility = CATDlgShow; pDialog->SetVisibility(ObjectVisibility); ... |
get visibility |
ObjectVisibility = pDialog->GetVisibiliy(ObjectVisibility); if (ObjectVisibility == CATDlgShow) ... // Object is visible else if (ObjectVisibility == CATDlgHide) ... // Object is not visible |
[Top]
The sensitivity of a dialog object is its ability to react to an end user interaction. It applies to dialog objects designed for this purpose, and can therefore be managed for thses objects only, such as push buttons, combos, and spinners.
A sensitive Apply push button. When the end user pushes it, it reacts by sending a notification to its parent in the command tree structure | |
A non sensitive Apply push button. It is displayed dimmed and can't be pushed. |
On the opposite, a label or a separator, that is used to display a text or an image, or to help dialog object layout, are not sensitive objects.
Use the SetSensitivity
, GetSensitivity
, and IsSetSensitivity
methods with the parameters CATDlgEnable
and CATDlgDisable
to manage the sensitivity of a dialog object.
set sensitivity |
CATULong ObjectSensitivity = CATDlgEnable; pDialog->SetSensitivity(ObjectSensitivity); ... |
get sensitivity |
ObjectSensitivity = pDialog->GetSensitivity(ObjectSensitivity); if (ObjectSensitivity == CATDlgEnable) ... // Object is sensitive else if (ObjectSensitivity == CATDlgDisable) ... // Object is not sensitive |
ask for sensitivity |
... CATBool IsSensitive; if(pDialog->IsSetSensitivity()) ... // Object is sensitive else ... // Object is not sensitive |
[Top]
The object's style can be retrieved thanks to the GetStyle method.
CATDlgStyle ObjectStyle; ObjectStyle = pDialog->GetStyle(); |
You can link an editor or a spinner to the PowerInput using the SetPowerInputLink method. The PowerInput mode should be already enabled.
int PowerInputLinkMode = 1; pEditor->SetPowerInputLink(PowerInputLinkMode); |
Valid values are:
1 | The object is linked to the Power Input |
0 | The object is not linked to the Power Input |
[Top]
Any object can set itself its location and extent in the grid [1] of its
parent object using the SetGridConstraints
and GetGridConstraints
methods.
set grid constraint |
CATDlgGridConstraints GridCsts(4, 2, 1, 1, CATGRID_4SIDES); pDialog->SetGridConstraints(GridCsts); |
set grid constraint parameters |
... // OR pDialog->SetGridConstraints(4, 2, 1, 1, CATGRID_4SIDES); |
get grid constraint |
... CATDlgGridConstraints NewGridCsts; NewGridCsts = pDialog->GetGridConstraints(); |
[Top]
The resources [1) are assigned to a dialog object from the resource files using the object identifier or name passed as the second argument of the dialog object constructor. Some resources can be automatically set using the DeclareResource macro. If the resource files doen't exist or are not found, resources can be hardcoded and assigned using methods, even if this is not recommended. In addition, some resources, such as the values displayed in a combo, must be extracted from the resource files, and set as the combo lines.
[Top]
You can do the following:
GetName
method.
CATString ObjectId; ObjectId = pDialog->GetName(); |
GetResourceID
and SetResourceID
methods.
get key |
CATString ObjectKey; ObjectKey = pDialog->GetResourceID(); ... |
set key |
ObjectKey = "NewKey"; pDialog->SetResourceID(ObjectKey); |
add message catalog |
CATMsgCatalog * MsgCat = new CATMsgCatalog(); //Message catalog is in file MsgFileName.CATNls MsgCat->LoadMsgCatalog("MsgFileName"); CATString Path("/u/users/psr/catalog"); pDialog->AddResourcePath(*MsgCat, Path); ... |
add resource catalog |
CATRscCatalog * RscCat = new CATRscCatalog(); //Resource catalog is in file RscFileName.CATRsc RscCat->LoadRscCatalog("RscFileName"); pDialog->AddResourcePath(*RscCat, Path); ... |
add message or resource catalog using its name |
CATString Name("CatalogName"); pDialog->AddResourcePath(Name, Path); |
The message catalogs are files suffixed by CATNls, such as MsgFileName.CATNls, and resource catalogs are files suffixed by CATRsc, such as RscFileName.CATRsc.
[Top]
You can do the following:
get title |
CATUnicodeString ucTitle; ucTitle = pDialog->GetTitle(); ... |
set title |
ucTitle = ...; pDialog->SetTitle(ucTitle); |
get mnemonic |
CATUnicodeChar ucMnemonic; ucMnemonic = pDialog->GetMnemonic(); ... |
|
set mnemonic |
ucMnemonic = ...; pDialog->SetMnemonic(ucMnemonic); |
get accelerator |
CATDlgAccelerator Accelerator; Accelerator = pDialog->GetAccelerator(); ... |
set accelerator |
pDialog->SetAccelerator(Meta|UIK_a); |
get accelerator |
CATUnicodeString ucAccelerator; ucAccelerator = pDialog->GetAcceleratorString(); ... |
set accelerator |
pDialog->SetAcceleratorString("Ctrl+a"); |
set icon names |
pDialog->SetIconName("IconNameNormal", "IconNameSelected", "IconNameFocussed", "IconNameDisabled",); |
set icon type |
pDialog->SetIconType(Modification); |
Valid icon types are Default, General, Creation, Modification, Analysis, and NonTransparent.
get help |
CATUnicodeString ucHelp; ucHelp = pDialog->GetHelp(); ... |
set help |
ucHelp = ...; pDialog->SetHelp(ucHelp); |
get short help |
CATUnicodeString ucShortHelp; ucShortHelp = pDialog->GetShortHelp(); ... |
set short help |
ucShortHelp = ...; pDialog->SetShortHelp(ucShortHelp); |
get Power Input help |
CATUnicodeString ucPowerInputHelp; ucPowerInputHelp = pDialog->GetPowerInputHelp(); ... |
set Power Input help |
ucPowerInputHelp = ...; pDialog->SetPowerInputHelp(ucPowerInputHelp); |
get long help |
CATUnicodeString ucLongHelp; ucLongHelp = pDialog->GetLongHelp(); ... |
set long help |
ucLongHelp = ...; pDialog->SetLongHelp(ucLongHelp); |
set status bar message |
CATUnicodeString ucStatusBarMsg = ...; pDialog->SetStatusBarText(ucStatusBarMsg); ... |
set status bar temporary message |
CATUnicodeString ucStatusBarTempMsg ...; pDialog->SetStatusBarTemporaryText(ucStatusBarTempMsg); |
CATString ObjectKey = "sKey"; CATUnicodeString ucValue; CATUnicodeSring ucParm[n]; ucParm[0] = ...; ucParm[1] = ...; ... int rc = pDialog->GetResourceValueFromKey(sKey, ucValue, ucParm); ... |
[Top]
[1] | Magnitude and Unit Reference |
[2] | Creating Dialog Objects |
[3] | Using Callbacks to Trigger Actions |
[4] | Editor |
[5] | Spinner |
[Top]
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.