Window Help Service |
Ver. 1.00 Contributed by Tim Roberts |
Note! This service must be used with PowerBuilder rev. 5.0.03 or above to prevent a memory leak. |
What
n_cst_winsrv_help - Window Help Service
Why
The PFC does not address application HELP adequately. It allows for a developer to code a single topic id or keyword in the window to be called if the user chooses HELP->HELP TOPICS. If the developer wishes to use context sensitive help, they would need to override the PFC_HELP event and code an elaborate routine (especially if the developer was using datawindows) to determine the help topic related to the current control. This routine would have to be repeated for each window context sensitive help is needed. Additionally as the window is maintained or enhanced, there is a high risk that the context sensitive help will be forgotten.
By implementing a help service, much of the grunt work and complexity can be eliminated.
How
To enable the help services:
- To enable the help services - in the open/constructor event of the window, place "of_sethelp(true)". This will create a help service object, inv_help.
- To determine what style of help to use - In the open/constructor event, code "inv_help.of_sethelpstyle(x)"
(where x is: [1] Show help index, [2] Show context sensitive help).- Call the pfc_help to execute help (Help->Help Topics automatically calls PFC_HELP).
Additional code if context sensitive help was chosen:
- Code "helpid=xxxx;" into the tag of any control (where xxxx is either the topic id or keyword). Note: this will also work if specified on a datawindow columns tag.
- If desired, choose a default topic id/keyword for those controls without the helpid tag coded by calling "inv_help.of_setdefaulthelpid(x)" (where x is either a topic id or keyword).
- If no default topic/keyword is specified, the help service will automatically show the index!. This default behavior can be changed by coding "inv_help.of_setignorenohelp(TRUE)". This will tell the help service to simply return 0 and show no help.
Additional function calls:
- To get the current help style, code "inv_help.of_gethelpstyle()" (returns integer).
- To get the current default help id, code "inv_help.of_getdefaulthelpid()" (returns any).
- To get the current ignore help flag, code "inv_help.of_getignorenohelp()" (returns boolean)
Suggestion:
For context sensitive help, either:
- In the applications master menu, change the Help->Help Topics to have a shortcut of F1
- Check for the F1 key in the KEY event of the window. If the F1 key was pressed, trigger the pfc_help event.
Option A is an easier implementation - it gives F1 context sensitive support for all windows immediately. The user simply has to highlight the field in question, press F1 and help on the topic is displayed.
Example Situations:
Show index for all fields
In open event of window, code:
of_SetHelp(TRUE) |
Context Sensitive help - all fields
Code "helpid=xxxxx;" in all objects tag field (including datawindow columns)
In open event of window, code:
of_SetHelp(TRUE) inv_help.of_SetHelpStyle(2) |
Context Sensitive help - most fields, ignore help for all other fields
Code "helpid=xxxxx;" in the objects tag field (including datawindow columns)
In open event of window, code:
of_SetHelp(TRUE) inv_help.of_SetHelpStyle(2) inv_help.of_SetIgnoreNoHelp(TRUE) |
Context Sensitive help - most fields, default to keyword "Checking Account" for all others
Code "helpid=xxxxx;" in the objects tag field (including datawindow columns)
In open event of window, code:
of_SetHelp(TRUE) inv_help.of_SetHelpStyle(2) inv_help.of_SetDefaultHelp("Checking Account") |
Download the | About the extension contributor |
Interested in contributing material to this web site? Send an email to submit@pfcguide.com, but don't forget to check the contribution guidelines first.
For information or suggestions about this web site please contact webmaster@pfcguide.com
PFCGuide is
sponsored by Dynamic Technology Group.
The information on this site is provided for advice only and not to be considered a
contract or a liability against Dynamic
Technology Group.