GEOS SDK TechDocs
|
|
3.1 Bringing Up Initial Help
|
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
HelpControlClass
. You must set its
HCI_helpType
field to the
HelpType
value it will manage. Because the standard behavior is to have the help window always appear on top of other dialog boxes, you should set the window priority accordingly (as shown). Also, because most controllers will come up disabled, set the GS_ENABLED flag to have the help buttons enabled when help is first invoked.
ATTR_GEN_HELP_TYPE
. The sample code shown does not have this attribute because the application uses multiple types but defaults to Normal Help. The user has the option of changing the help type; when the type is changed,
ATTR_GEN_HELP_TYPE
is added to the GenApplication dynamically.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;
}
GEOS SDK TechDocs
|
|
3.1 Bringing Up Initial Help
|
3.3 Sizing the Help Dialog Box