OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Capturing the Mouse For a Gadget

A gadget is always notified when the left mouse button is pressed down within its bounding rectangle.

After the button is pressed, you need to capture the mouse if you want to send notification of mouse movements. You can do this using the TGadgetWindow::GadgetSetCapture and TGadgetWindow::GadgetReleaseCapture 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's Window pointer to its gadget window.