Progress
Help Development
Guide
Implementing Context-sensitive Help with the Progress 4GL
In the Progress 4GL, when the user clicks on the question mark icon to initiate a context-sensitive help operation, the following occurs:
- The mouse cursor changes to a pointer with a question mark. This cursor overrides any cursor that has been loaded by the LOAD-MOUSE-POINTER( ) method.
- If the user clicks outside of the dialog box or window, clicks within the dialog box or window but not on a field level widget, presses the ESC key, CTRL-ESC, or ALT-TAB, the operation is cancelled and the mouse cursor returns to its prior state.
- If the user clicks on a widget in the dialog box or window, the mouse cursor returns to its prior state and Progress displays the help topic by following these rules:
- If the widget’s CONTEXT-HELP-ID attribute has been set and a help file has been specified, the Progress 4GL calls the help system to display the help topic. If the help file does not contain an entry for the specified context ID, the help system displays the message “No Help topic is associated with this item.” If the help file itself does not exist, the help system asks whether the user wants to try to locate it.
- If the widget’s HELP attribute contains a non-empty string, a pop-up window is displayed containing the help string.
- Otherwise, the help system displays a pop-up window stating “No Help topic is associated with this item.”
Context-sensitive help supports the following attributes, statements, and phrases:
CONTEXT-HELP Attribute
The CONTEXT-HELP attribute applies to window and dialog box widgets. It is a logical value. When CONTEXT-HELP is TRUE, a question mark icon displays in the title bar of the window or dialog box. CONTEXT-HELP is both readable and writable; however, it must be set before the window or dialog box is realized. The default value of CONTEXT-HELP is FALSE.
Microsoft Windows does not permit the question mark icon to appear, or it appears but does not function, when combined with these other attribute settings that affect a window’s title bar:
- If CONTEXT-HELP = TRUE and SMALL-TITLE = TRUE, the question mark icon does not appear.
- If CONTEXT-HELP = TRUE and both MIN-BUTTON = TRUE and MAX-BUTTON = TRUE, the question mark icon does not appear.
- If CONTEXT-HELP = TRUE and either (but not both) of MIN-BUTTON or MAX-BUTTON = TRUE, the question mark icon appears but does not function.
- If CONTEXT-HELP = TRUE and CONTROL-BOX = FALSE, the question mark icon does not appear.
To summarize, you must set CONTEXT-HELP = TRUE, MIN-BUTTON = FALSE, and MAX-BUTTON = FALSE (leaving CONTROL-BOX and SMALL-TITLE at their default FALSE values) to successfully use this feature with a window widget.
NOTE: The preceding settings only apply to window widgets, not to dialog boxes. The question mark icon always functions correctly when used with a dialog box.CONTEXT-HELP-FILE Attribute
The CONTEXT-HELP-FILE attribute specifies the path of a help file (.hlp) associated with a dialog box, window, or session. (The full path of the help file is required; Progress does not search for the help file.) This attribute is a character value and is readable and writable. It applies to the dialog box widget, window widget, and SESSION handle.
If the CONTEXT-HELP-FILE is not specified (is UNKNOWN) for a dialog box, the dialog box inherits the help file of its parent window. If the parent window’s CONTEXT-HELP-FILE is also UNKNOWN, it inherits the session’s help file (specified by SESSION:CONTEXT-HELP- FILE).
CONTEXT-HELP-ID Attribute
The CONTEXT-HELP-ID attribute specifies the context ID of a help topic in a help file. It is an integer value and is readable and writable. It applies to the following widgets:browse, button, combo-box, control frame, editor, fill-in, radio-set, selection-list, slider, and toggle box.
DEFINE BROWSE Statement
When the CONTEXT-HELP-ID attribute is used with the DEFINE BROWSE statement, it specifies the context ID of a help topic for this browse. The help file is specified at the session, window, or dialog box level using the CONTEXT-HELP-FILE attribute. The syntax for the DEFINE BROWSE statement follows:
DEFINE BUTTON Statement
When the CONTEXT-HELP-ID attribute is used with the DEFINE BUTTON statement it specifies the context ID of a help topic for this button. The help file is specified at the session, window, or dialog box level using the CONTEXT-HELP-FILE attribute. The syntax for the DEFINE BUTTON statement follows:
DEFINE VARIABLE Statement
When the CONTEXT-HELP-ID attribute is used with the DEFINE VARIABLE statement, it specifies the context ID of a help topic for this variable. The help file is specified at the session, window, or dialog box level using the CONTEXT-HELP-FILE attribute. The syntax for the DEFINE VARIABLE statement follows:
Frame Phrase
When the CONTEXT-HELP attribute of the Frame Phrase is used with the DEFINE FRAME and FORM statements, among others, it specifies that context-sensitive help is available for that frame.
When the CONTEXT-HELP-FILE attribute of the Frame Phrase is used with the DEFINE FRAME and FORM statements, among others, it specifies the complete path of a help file associated with that frame. If CONTEXT-HELP-FILE is specified without CONTEXT-HELP, CONTEXT-HELP is assumed. This behavior can be overridden by setting the dialog box’s CONTEXT-HELP attribute to FALSE at run time. The syntax for the Frame Phrase follows:
Example
The following example displays a dialog box with two fill-ins and two buttons. It demonstrates several ways help can be accessed:
- The first fill-in (A) has a HELP string defined in this procedure.
- The second fill-in (customer.credit-limit) inherits its HELP string from the database schema.
- The button labeled “Help Available” has CONTEXT-HELP-ID specified.
- The button labeled “No Help Available” has neither a HELP string nor CONTEXT-HELP-ID specified.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |