Help Object Library: 2.2 Adding Help to Your Application: Adding Default Normal Help

Up: GEOS SDK TechDocs | Up | Prev: 2.1 Help Contexts and Help Triggers | Next: 2.3 Bringing Up Help on the Fly

To add normal help to your application, you only need to add ATTR_GEN_HELP_CONTEXT to the objects that should have help contexts. You can look at the HelpSamp sample application, though that does much more than you need. The code shown in Objects with Help Contexts is taken from HelpSamp and shows a dialog box with a list, in which each entry has its own context.

You will want to put ATTR_GEN_HELP_CONTEXT on any generic object that could conceivably need help text. Nearly all applications will put help only on GenInteractions and GenPrimaries, but it is available for all generic objects. For example, items in a GenItemGroup may have help contexts (as shown in HelpSamp) so that when the user hits the F1 key, help will be invoked for that particular item. Likewise, menus and menu items may have their own help contexts.

Nearly all GenPrimary objects should have the context "TOC" set for them.

Code Display 13-1 Objects with Help Contexts

/*     The TypeDialog box has its own help context: Help Types. This will cause
 * the UI to put a help trigger in the dialog's reply bar and, when that trigger
 * is clicked, will cause the system's help object to bring up the normal help
 * viewer on the "Help Types" page in the current help file.
 *     Each item in the GenItemGroup has its own help context. The list itself
 * does not have a context because if the user presses the F1 key, the help system
 * will bring up the selected item's help. If it were a list in which there could
 * be zero items selected, then the list might have its own context as well. */
@object GenInteractionClass TypeDialog = {
    GI_visMoniker = 'T', "Change Help Type";
    GI_comp = @TypeList;
    GII_visibility = GIV_DIALOG;
    GII_type = GIT_PROPERTIES;
    ATTR_GEN_HELP_CONTEXT = "Help Types";
}
@object GenItemGroupClass TypeList = {
    GI_comp = @NormalItem, @FirstAidItem, @SimpleItem;
    GIGI_numSelections = 1;
    GIGI_selection = HT_NORMAL_HELP;
    GIGI_applyMsg = MSG_HELPSAMP_SET_TYPE;
    GIGI_destination = process;
    HINT_ORIENT_CHILDREN_VERTICALLY;
}
@object GenItemClass NormalItem = {
    GI_visMoniker = "Normal Help";
    GII_identifier = HT_NORMAL_HELP;
    ATTR_GEN_HELP_CONTEXT = "Normal Help";
}
@object GenItemClass FirstAidItem = {
    GI_visMoniker = "First Aid";
    GII_identifier = HT_FIRST_AID;
    ATTR_GEN_HELP_CONTEXT = "First Aid";
}
@object GenItemClass SimpleItem = {
    GI_visMoniker = "Simple Help";
    GII_identifier = HT_SIMPLE_HELP;
    ATTR_GEN_HELP_CONTEXT = "Simple Help";
}

Up: GEOS SDK TechDocs | Up | Prev: 2.1 Help Contexts and Help Triggers | Next: 2.3 Bringing Up Help on the Fly