This help file describes the facilities available in libUtil.a, which is a utility library used in the demonstration programs. Included are a help widget, a style-guide compliant menu generator and a print widget. Help Widget The help widget provides a means for the demo applications to present help to the user in a easy to navigate form. UxmCreateHelp Widget UxmCreateHelp(Widget parent, char* name, ArgList args, Cardinal num_args) Description: This function returns a help widget. Arguments: parent The parent of the widget to be created. name The name of the created widget. args List of arguments to pass to XtCreateWidget. num_args The count of arguments. UxmCreateHelpDialog Widget UxmCreateHelpDialog(Widget parent, char* name, ArgList args, Cardinal num_args) Description: Creates a help widget within a dialog shell (XmCreateTemplateDialog) with one button labeled Dismiss. Otherwise the arguments and return value are the same as for UxmCreateHelp. UxmGotoHelpItem void UxmGotoHelpItem(Widget widget, XmString item, XtPointer cb) Description: An XtCallbackProc to make writing contextual help simple. This takes an XmString as the argument. Otherwise the arguments are the same as for any XtCallbackProc. Widget Resources UxmNhelpFile The filename of the help file. The suffix .help can be omitted. UxmNhelpPath This is the pathname to use to search for the help file. Should this not be set, the widget uses XFILESEARCHPATH and ./%N.%S in addition. Note that the type and suffix (%T and %S) will both be set to help. XmNrenderTable The default rendertable is generated by the widget. You can pass in one in widget creation to take the default's place, or you can do a getvalues/setvalues to update the rendertable with extra renditions (as this demo does). Markup language The markup language is an SGML-like language with renditions specified as \ to start a rendition and \ to end a rendition. The \< or \> characters can be included using the escape character, \\. Renditions defined by default: Name Rendition Comments title helvetica bold 14 Creates a new major tab subtitle helvetica bold 12 Creates a new minor tab heading helvetica bold 14 bold helvetica bold 12 emphasis helvetica oblique 12
Extra renditions used in this demo and defined in onHelp.c: Name Rendition Comments table Tabs @ 2" and 4" New tablist for tables underline Single Underline Good for table headings program Courier 12 For programmatic text Help menus A style guide compliant help menu should have the following items:
Item Mnemonic Overview O Index I Table Of Contents C Tasks T Reference R Tutorial L Keyboard K Mouse M On Item Using Help U About App. A
Menu generator The menu generator is quite simple. You call it with a description value (obtained from Menus.h) and it returns a widget list of the menu items. It manages the required elements from the style guide. Print widget The print dialog widget provides a concise dialog to obtain information for printing. The dialog consist of a number of fields which the user can specify. The application writer can specify the initial values of the fields and can reset them through XtSetValues. Resources Resource Type Class Default UxmNprinterList char* UxmCPrinterList NULL UxmNtwoSided Boolean UxmCTwoSided False UxmNreverseOrder Boolean UxmCReverseOrder False UxmNfromPage Integer UxmCFromPage 0 UxmNtoPage Integer UxmCToPage 0 UxmNprintAll Boolean UxmCPrintAll True UxmNnumberOfCopies Integer UxmCNumberOfCopies 1 UxmNprintCallback CallbackList XmCCallback NULL