class GUIDropDownHitBox

Helper class used for detecting when a certain area is in focus, and getting notified when that state changes.

Public

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

Returns type name of the GUI element used for finding GUI element styles.

staticCreate

static GUIDropDownHitBox *Create(bool captureMouseOver, bool captureMousePresses)

Creates a new drop down hit box that will detect mouse input over certain area.

You must call setBounds() to define the area.

captureMouseOver
If true mouse over/out/move events will be captured by this control and wont be passed to other GUI elements.
captureMousePresses
If true mouse clicks will be captured by this control and wont be passed to other GUI elements.

staticCreate

static GUIDropDownHitBox *Create(bool captureMouseOver, bool captureMousePresses, const GUIOptions &options)

Creates a new drop down hit box that will detect mouse input over certain area.

You must call setBounds() to define the area.

captureMouseOver
If true mouse over/out/move events will be captured by this control and wont be passed to other GUI elements.
captureMousePresses
If true mouse clicks will be captured by this control and wont be passed to other GUI elements.
options
Options that allow you to control how is the element positioned and sized. This will override any similar options set by style.

SetBounds

void SetBounds(const GUIPhysicalArea &bounds)

Sets a single rectangle bounds in which the hitbox will capture mouse events.

SetBounds

void SetBounds(const Vector<GUIPhysicalArea> &bounds)

Sets complex bounds consisting of multiple rectangles in which the hitbox will capture mouse events.

Fields

OnFocusLost

Event<void ()> OnFocusLost

Triggered when hit box loses focus (for example user clicks outside of its bounds).

OnFocusGained

Event<void ()> OnFocusGained

Triggered when hit box gains focus (for example user clicks inside of its bounds).

Private

Constructors

GUIDropDownHitBox

GUIDropDownHitBox(bool captureMouseOver, bool captureMousePresses, const GUISizeConstraints &dimensions)

Methods

DoOnCommandEvent

bool DoOnCommandEvent(const GUICommandEvent &ev) override

Called when a command event is triggered.

Return true if you have processed the event and don't want other elements to process it.

DoOnMouseEvent

bool DoOnMouseEvent(const GUIMouseEvent &ev) override

Called when a mouse event is received on any GUI element the mouse is interacting with.

Return true if you have processed the event and don't want other elements to process it.

IsInInteractionBounds

bool IsInInteractionBounds(const GUIPhysicalPoint &position) const override

Checks is the specified position within interactable bounds of a GUI element.

These are the bounds that will be used for hit tests for e.g. mouse cursor. By default this is the same as the absolute clipped bounds of the GUI element. Position is relative to parent GUI widget.

Fields

mBounds

Vector<GUIPhysicalArea> mBounds

mCaptureMouseOver

bool mCaptureMouseOver

mCaptureMousePresses

bool mCaptureMousePresses