CheckBox.mouseButtonEvent

The mouse button callback will return true when all three conditions are met:

1. This CheckBox is "enabled" (see nanogui.Widget.mEnabled). 2. p is inside this CheckBox. 3. button is MouseButton.Left.

Since a mouse button event is issued for both when the mouse is pressed, as well as released, this function sets nanogui.CheckBox.mPushed to true when parameter down == true. When the second event (down == false) is fired, nanogui.CheckBox.mChecked is inverted and nanogui.CheckBox.mCallback is called.

That is, the callback provided is only called when the mouse button is released, **and** the click location remains within the CheckBox boundaries. If the user clicks on the CheckBox and releases away from the bounds of the CheckBox, nanogui.CheckBox.mPushed is simply set back to false.

class CheckBox
override
bool
mouseButtonEvent

Meta