![]() |
Dialog ManagerVersion: 2.0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Callback functionsThe application has to implement a callback function for each modal, modeless, and palette dialog. The callback function is called with DG messages to handle user actions not handled by DG. The prototype of the callback function is the following: typedef short (*DGDialCallBack) (
short message,
short dialId,
short itemId,
long userData,
long msgData
);
Parameters
Return ValuesThe return value of the callback function is not investigated except for the following cases:
In all other cases the application should return zero. RemarksThe pointer to the callback function should be passed in the dCallBack parameter of the DGModalDialog or DGModelessInit functions. For the simplest modal dialogs that have only buttons and static items (static text, picture, icon, etc.) there is no need to implement a callback function. In this case DGModalDialog returns only if a button is clicked. Tab pages are special dialogs, because they have no dialog callback function. Messages for controls on tab pages are sent to the callback function of the main dialog (the dialog that contains the tab control). For these messages, however, the ID of the tab page subdialog is passed to the callback function in the dialId parameter instead of the ID of the main dialog. For DG messages that related to a dialog instead of a particular dialog item, the itemId parameter is zero. These messages are the following: DG_MSG_ACTIVATE, DG_MSG_GROW, DG_MSG_HOTKEY, DG_MSG_INIT and DG_MSG_NULL. The application can assign a long value to every dialog. This long value can be used to store any dialog-specific user data. It can be given when creating the dialog by DGModalDialog or DGModelessInit as the userData parameter of these functions, or can be modified later by DGSetDialogUserData. When handling DG messages in the dialog callback function, this dialog specific data is available as the userData parameter of the message. You can retrieve this value whenever you need by DGGetDialogUserData. It is advised to gather all the dialog related data into a user-defined structure. After filling this structure, give its pointer (handle) cast to long to DGModalDialog or DGModelessInit. If a dialog has one ore more tab pages, they have a common user data. In the msgData parameter of the callback function you can get message-specific data. For details see the description of the DG messages. See AlsoDialog Manager,
DG Messages,
Modal dialogs,
Modeless dialogs,
Palette dialogs,
Tab pages,
Dialog item types |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Copyright © 2006 - Graphisoft R&D Zrt. All rights reserved worldwide. Built on January 24, 2003 |