OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Setting the Hint Mode

The hint mode of a gadget dictates when hints about the gadget are displayed by the gadget window's parent.

You can set the hint mode for a gadget using the TGadgetWindow::SetHintMode function:

void SetHintMode(THintMode hintMode);

The enum THintMode has three possible values:

hintModeDisplay status
NoHintsHints are not displayed.
PressHintsHints are displayed when the gadget is pressed until the button is released.
EnterHintsHints are displayed when the mouse passes over the gadget (when the mouse enters the gadget).

You can find the current hint mode using the TGadgetWindow::GetHintMode function:

THintMode GetHintMode();

Another function, the TGadgetWindow::SetHintCommand function, determines when a hint is displayed:

void SetHintCommand(int id);

This function is usually called by a gadget through the gadget's Window 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:

  • The decorated frame window parent of the gadget window must have a message or status bar.
  • Hints must be on in the frame window.
  • There must be a string resource with the same identifier as the gadget. For example, if the gadget identifier is CM_MYGADGET, you must also have a string resource defined as CM_MYGADGET.