Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Help System Developer's Guide > Chapter 5 Creating and Managing Help Dialogs

The Quick Help Dialog

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Within a quick help dialog, users can get to more help using hyperlinks within the displayed topic.

One of the dialog's buttons is application-defined, so this button can be used for anything. However, its intended purpose is to provide a path to more help in one of these two ways:

  • Let the user ask for more detailed information. In this case, the default button label ("More") is appropriate. This is called "progressive disclosure."

  • Or, let the user open a general help dialog for general browsing of the application's help volume. In this case, "Browse..." is the most appropriate button label.

The HP Help programmer's toolkit includes a convenience function for determining the widget ID for any of the quick help dialog buttons.

To create a quick help dialog

  1. Include the appropriate header files:

       #include Xvh.h
    
       #include QuickHelpD.h
    
  2. Create an instance of the quick help dialog widget:

    • Use the XvhCreateQuickHelpDialog() convenience function.

    • Or, use the XtCreateManagedWidget() function.

  3. Add a callback for handling hyperlink events that occur within the dialog. (This is described in more detail in “Responding to Hyperlink Events”.)

  4. Add a close callback for handling the OK button.

  5. Configure the dialog buttons that you want to use:

    • If you intend to use the application-defined button, manage it and add an activate callback.

    • If you want to disallow printing, unmanage the Print button.

    • Manage the Help button and add a help callback to the dialog to allow the user to get help on help.

Example. The following code segment creates a quick help dialog (as a child of parent) using the convenience function. The dialog is left unmanaged; presumably it is managed elsewhere in the application when a help request is made. In this example, the application-defined button is enabled and used to request "more" help.

   Widget   quickHelpDialog, moreButton, helpButton;



   ac = 0;

   XtSetArg (al[ac], XmNtitle, "My Application - Help");  ac++;

   quickHelpDialog = 

     XvhCreateQuickHelpDialog (parent, "quickHelpDialog", al, ac);

The following two calls add the hyperlink and close callbacks to the dialog. Presumably, the functions HyperlinkCB() and CloseHelpCB() are declared elsewhere in the application.

   XtAddCallback (quickHelpDialog, XmNhyperLinkCallback, HyperlinkCB, (XtPointer)NULL);

   XtAddCallback (quickHelpDialog, XmNcloseCallback, CloseHelpCB, (XtPointer)NULL);

Here, the application-defined button is managed and assigned an activate callback that invokes the application's MoreHelpCB() function.

   moreButton = XvhQuickDialogGetChild (quickHelpDialog, XvhDIALOG_MORE_BUTTON);

   XtManageChild (moreButton);

   XtAddCallback (moreButton, XmNactivateCallback, MoreHelpCB, (XtPointer)NULL);

To provide "help on help," the dialog's Help button is managed and a help callback is added to the dialog.

   helpButton = XvhQuickDialogGetChild (quickHelpDialog, XvhDIALOG_HELP_BUTTON);

   XtManageChild (helpButton);

   XtAddCallback (quickHelpDialog, XmNhelpCallback, HelpRequestCB, USING_HELP);

Like other OSF/Motif dialogs, when you add a help callback to a quick help dialog, it is used by both the F1 key and the Help button.

See Also. 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1988 Hewlett-Packard Development Company, L.P.