A SERVICE OF

logo

A gadget is always notified when the left mouse button is pressed down
Capturing the
within its bounding rectangle. After the button is pressed, you need to
mouse for a gadget
capture the mouse if you want to send notification of mouse movements.
Y u can do this using the GadgetSetCapture and GadgetReleaseCaptureo
functions:
BOOL GadgetSetCapture(TGadget& gadget);
void GadgetReleaseCapture(TGadget& gadget);
The gadget parameter for both functions indicates for which gadget the
window should set or release the capture. The BOOL returned by
GadgetSetCapture indicates whether the capture was successful.
These functions are usually called by a gadget in the window through the
gadget’ Window pointer to its gadget window.s
The hint mode of a gadget dictates when hints about the gadget are
Setting the hint
displayed by the gadget window’ parent. Y u can set the hint mode for as o
mode
gadget using the SetHintMode function:
void SetHintMode(THintMode hintMode);
The enum THintMode has three possible values:
__________________________________________________________________________
Table 11.1
hintMode Hint displayed
Hint mode flags
____________________________________________________________________
NoHints
Hints are not displayed.
P essHints
Hints are displayed when the gadget is pressed until the button is released.
r
EnterHints
Hints are displayed when the mouse passes over the gadget; that is, when the
mouse enters the gadget.
____________________________________________________________________
Y u can find the current hint mode using the GetHintMode function:o
THintMode GetHintMode();
Another function, the SetHintCommand function, determines when a hint is
displayed:
void SetHintCommand(int id);
This function is usually called by a gadget through the gadget’ Windows
pointer to its gadget window but the gadget window could also call it.,
Essentially SetHintCommand simulates a menu choice, making pressing the,
gadget the equivalent of selecting a menu choice.
For SetHintCommand to work properly with the standard ObjectWindows
classes, a number of things must be in place:
270
OWL P ogrammer’ Guider s