Help Balloons in Dynamic Windows
To create help balloons for objects whose location in the content area
of windows may vary, your application needs to use Help Manager routines to display and remove balloons as the user moves the cursor.
You should display or remove help balloons for dynamic windows at
the same time that you normally check the mouse position to display or
change the cursor. For example, if you provide your own DoIdle
procedure, you can also check the mouse position and, if the cursor is
over a hot rectangle, you should display the associated help balloon.
To create help balloons for the content area of a dynamic window, you
need to
• identify the hot rectangles for each area or object
• create data structures to store the locations of the hot rectangles
• determine how to calculate their changing locations
• track and update the hot rectangles
• when the cursor is over a hot rectangle, display its help balloon
After defining all the hot rectangles within your content region,
create separate 'STR ', 'STR#', 'PICT', or 'TEXT' and 'styl' resources
for the help balloons' content. You do not have to store the content in
your application easier to localize.
responsible for tracking the cursor and determining when to display
the help balloon. If you use the HMShowBalloon function, you can let the Help Manager track the cursor and determine when to remove the help balloon, or your application can remove the balloon when
should use the HMGetBalloons function to determine whether help is enabled before displaying a help balloon. If help is not enabled, you do
not need to call any Help Manager routines that display balloons, since they will not do anything unless HMGetBalloons returns TRUE. • windows whose content changes
• windows that can be resized
• windows that contain hot rectangles with variable locations
• situations in which your application wants more control over
the display and removal of the help balloon
For example, windows with scrolling file icons (such as Finder
windows) or scrolling tool symbols (such as those shown in the Figure,
"Static and Dynamic Windows" above) require you to use
Likewise, if you have tools-such as rulers that users configure for tab
stops in a word-processing document-that scroll with a document, you
scrolling tools.
describes how to override these default help balloons.
location, a rectangle to use if the Help Manager needs to change the tip location, an optional pointer to a function that can modify the tip
and rectangle coordinates, the balloon definition function, and the
function, you should also provide a constant that tells the
Help Manager whether it should save the bits behind the balloon. theProc, variant, method);
Specify the help content in the aHelpMsg parameter to the
each hot rectangle using text strings, 'STR ' resource types, 'STR#'
resource types, styled text resources, 'PICT' resource types, handles
to styled text records, or handles to pictures.
The hmmHelpType field is a constant that specifies the data type of the next field of the help message record. The field following the
hmmHelpType field can be one of a number of different data types. You
specify the content of the help balloon in this field.
You can specify the help content using a text string, a text string
stored in a resource of type 'STR ', or a text string stored as a an
'STR#' resource. You can also provide the information using styled
text resources, or you can provide a handle to a styled text record. If
you want to provide the help content as a picture, you can use a
resource of type 'PICT' or provide a handle to a picture.
You specify a constant for the hmmHelpType field.
You can use the khmmString constant to specify a Pascal string.
Here's an example of how to use the khmmString constant in the help
message record. (Although you can specify a string from within your
code, storing the strings in resources and then accessing them through