Specifying the Format for Help Balloon Content
Specifying the Format for Help Balloon Content
You specify the format for the content of your help balloons as text
strings within the help resource, as text strings within 'STR '
resources, as lists of text strings within 'STR#' resources, as styled
text using 'TEXT' and 'styl' resources, or as pictures within 'PICT'
resources.
You can easily add Balloon Help on-line assistance to your existing
application without changing its code by adding the help resources
described in the section en titled Using the Help Manager. When
you use help resources, the Help Manager tracks the cursor and
displays and removes help balloons for you. With the individual
routines you can also provide Balloon Help on-line assistance without
using the help resources. However, this requires that your application
track the cursor and display and remove balloons.
Individual sections describe all the help resources in detail. Common
to all the help resources are the following identifiers, by which you
identify the format of your user help information:
Identifier Help content format
HMStringItem Pascal string within the help resource
HMPictItem 'PICT' resource
HMStringResItem 'STR#' resource
HMTEResItem 'TEXT' and 'styl' resources
HMSTRResItem 'STR ' resource
HMSkipItem No content-skip this item
You can use the HMStringItem identifier to store Pascal strings
directly in a help resource. However, you can make it much easier to
localize your product by storing your user help content in separate
resources-namely, in 'STR#', 'PICT', 'STR ', and 'TEXT'
resources-that can be modified by non programmers using tools like
the ResEdit resource editor.
To display a diagram or illustration in 'PICT' format, use the
HMPictItem identifier. You provide help content by specifying the
resource ID of the 'PICT' resource that contains the diagram or
illustration, and the
Help Manager displays the picture in a help balloon.
To display a string stored in a string list ('STR#') resource, use the
HMStringResItem identifier. As illustrated in the section under the
heading, Providing Help Balloons for Menus, you provide help
content by specifying two items in your help resource: the resource ID
of an 'STR#' resource, and the index to the particular string that you
want displayed from within that list.
To display styled text, use the HMTEResItem identifier. You provide
help content by specifying a resource ID that is common to both a style
scrap ('styl') resource and a 'TEXT' resource, and the Help Manager
employs TextEdit routines to display your text with your prescribed
styles. For example, you might create a 'TEXT' resource with resource
ID 1000 that contains the words "Displays your text in boldface print
and a 'styl' resource with resource ID 1000 that applies boldface style
to the message. (See TextEdit for a description of the style scrap.)
To display text from a simple text string ('STR ') resource, use the
HMSTRResItem identifier. You provide help content by specifying the
resource ID of an 'STR ' resource, and the Help Manager displays the
text from that resource in a help balloon. With 'STR ' resources, each
text string must be stored in a separate resource. It is usually more
convenient to group related help messages in a single 'STR#' resource
and use the HMStringResItem identifier.
You can use the HMSkipItem identifier for items or rectangles for
which you do not want to provide a help balloon. For example, you
specify HMSkipItem for the dashed lines that appear in menus. (Dashed
lines cannot have help balloons.)