OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Class TButtonGadget

Button gadgets are the only type of gadget included in ObjectWindows that the user interacts with directly.

Control gadgets also provide a gadget that receives input from the user, but they do so through a control class. The gadget in that case only acts as an intermediary between the control and gadget window.

There are three normal button gadget states: up, down, and indeterminate. In addition the button can be highlighted when pressed in all three states. There are two basic type of button gadgets, command gadgets and setting gadgets. Setting gadgets can be exclusive (like a radio button) or non-exclusive (like a check box). Commands can only be in the up state. Settings can be in all three states.

A button gadget is pressed when the user presses the left mouse button while the cursor position is inside the gadget's bounding rectangle. The gadget is highlighted when pressed.

After the gadget has been pressed, it captures the mouse's movements. When the mouse moves outside the gadget's bounding rectangle without the left mouse button being released, highlighting is canceled but mouse movements are still captured by the gadget. The gadget is highlighted again when the mouse comes back into the gadget's bounding rectangle without the left mouse button's being released.

When the left mouse button is released, mouse movements are no longer captured. If the cursor position is inside the bounding rectangle when the button is released, the gadget identifier is posted as a command message by the gadget window.

See Also

To work with button gadgets, see:

For information on working with other gadgets or with gadget windows, see: