HP OpenVMS Systems Documentation |
Common Desktop Environment: Help System Author's and Programmer's Guide 11 Handling Events in Help DialogsContents of Chapter: This chapter describes several Help dialog events that an application must be equipped to handle. Supporting Help Dialog EventsLike other widgets within your application, help windows have some behavior that must be supported by the application.Hyperlink EventsMost standard hyperlink events are handled internally by the Help System. However, there are four types of hyperlinks that your application is responsible for handling:
When Dialogs Are DismissedWhen the user closes a help dialog, your application needs to know so it can store the dialog in its cache, or destroy it. The general help dialog supports a help closed callback. To detect when a quick dialog is dismissed, add a callback to its Close button.Quick Help ButtonsThe behavior for some of the buttons in quick help dialogs must be handled by your application. These buttons can be managed and unmanaged as needed. You add behavior just like any other push button: using an activate callback.See Also
Responding to Hyperlink EventsYour application needs to provide support only for the types of hyperlinks used within the help volume to be displayed. In general, it is recommended that you provide support for all link types.For your application to be notified when a hyperlink is chosen, it must add a hyperlink callback to the help dialog. You must write a callback function that handles the hyperlink appropriately. To Provide a Hyperlink Callback
The hyperType element indicates which type of link was executed. Its possible values are: DtHELP_LINK_TOPIC, DtHELP_LINK_MAN_PAGE, DtHELP_LINK_APP_DEFINE, or DtHELP_LINK_TEXT_FILE. For a description of which structure elements are valid for different types refer to the DtHelpDialog(3) man page.
The ExampleThe following function, HyperlinkCB(), illustrates the general structure needed to handle hyperlink callbacks.
Detecting When Help Dialogs Are DismissedTo detect when a general help dialog is closed, add the following callback to the dialog:
Where helpDialog is the widget ID for the help dialog and HelpCloseCB is the name of the callback procedure you've written to handle closing dialogs. To detect when a quick help dialog is closed, add the following callback to the dialog's OK button:
Where helpDialog is the widget ID for the help dialog and HelpCloseCB is the name of the callback procedure you've written to handle closing dialogs. Using the Application-Configured ButtonThe quick help dialog's application-configured button lets you add custom behavior to any quick help dialog. This button can be used for anything you want, but its intended purpose is to provide a path to more help in one of these two ways:
To Enable the Application-Configured Button
ExampleThe following code segment gets the button's ID, assigns a callback, and manages the button. It assumes that quickHelpDialog was just created.
See Also
|