Help Object Library: 3.2 Customizing Help: Adding the HelpControl

Up: GEOS SDK TechDocs | Up | Prev: 3.1 Bringing Up Initial Help | Next: 3.3 Sizing the Help Dialog Box

To add a help controller to your application, simply declare an instance of HelpControlClass and add it as a child of your GenApplication, adding it to the active list. The code in Adding Help Controllers is taken from the HelpSamp sample application and illustrates what you have to do to support custom help. The steps are

Other than the above customizations, using another help type is as simple as using Normal Help. Other considerations must be observed when creating the help files, but the code difference is simple.

Code Display 13-2 Adding Help Controllers

/*    The GenApplication has two help controllers as its children.
 * FirstAidHelpControl manages First Aid help, and SimpleHelpControl manages
 * Simple Help. In addition, the Normal Help controller--provided by the
 * system--manages Normal Help. Both custom help controllers must be put both on
 * the active list and on the GAGCNLT_NOTIFY_HELP_CONTEXT_CHANGE list.
 *    Normally, the GenApplication would have ATTR_GEN_HELP_TYPE declaring the
 * help type used. This application, however, defaults to HT_SYSTEM_HELP and
 * therefore does not need the attribute. */
@object GenApplicationClass HelpSampApp = {
    GI_visMoniker = list { @HelpSampTextMoniker };
    GI_comp = @HelpSampPrimary, @FirstAidHelpControl, @SimpleHelpControl;
    gcnList(MANUFACTURER_ID_GEOWORKS,GAGCNLT_WINDOWS) = @HelpSampPrimary;
    gcnList(MANUFACTURER_ID_GEOWORKS, GAGCNLT_NOTIFY_HELP_CONTEXT_CHANGE) =                                     @FirstAidHelpControl, @SimpleHelpControl;
    gcnList(MANUFACTURER_ID_GEOWORKS, MGCNLT_ACTIVE_LIST) =
				@FirstAidHelpControl, @SimpleHelpControl;
}
@visMoniker HelpSampTextMoniker = "C Sample App with Help";
/*    The help controllers may manage at most one HelpType each. Thus, you must
 * set the HCI_helpType field so the controller knows what type of help it
 * manages. */
@object HelpControlClass FirstAidHelpControl = {
    GI_states = @default | GS_ENABLED;
    HCI_helpType = HT_FIRST_AID;
}
@object HelpControlClass SimpleHelpControl = {
    GI_states = @default | GS_ENABLED;
    HCI_helpType = HT_SIMPLE_HELP;
}

Up: GEOS SDK TechDocs | Up | Prev: 3.1 Bringing Up Initial Help | Next: 3.3 Sizing the Help Dialog Box