CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::UIUtility Struct Reference

A set of common and useful functions for implementing UIs. More...

#include <CeresEngine/UI/UIUtility.hpp>

Static Public Member Functions

static bool makeFirstResponder (UIView *view)
 Makes the view the first responder in it's window.
 
static bool isOver (const UIView *view, const UIMouseEvent &event)
 A utility method that checks if the event occurred over the view.
 
static bool forwardInputEvent (UIWindow *window, const AnyInputEvent &event)
 A utility method that forwards a generic AnyEvent to the given window.
 

Detailed Description

A set of common and useful functions for implementing UIs.

Member Function Documentation

◆ forwardInputEvent()

static bool CeresEngine::UIUtility::forwardInputEvent ( UIWindow window,
const AnyInputEvent event 
)
static

A utility method that forwards a generic AnyEvent to the given window.

◆ isOver()

static bool CeresEngine::UIUtility::isOver ( const UIView view,
const UIMouseEvent event 
)
static

A utility method that checks if the event occurred over the view.

This is useful for checking if the event was a click-drag, which can be handled as a cancellation.

Parameters
viewThe view to be checked.
eventThe event to extract the location for.
Returns
true if the event occurred over the view, false otherwise.

◆ makeFirstResponder()

static bool CeresEngine::UIUtility::makeFirstResponder ( UIView view)
static

Makes the view the first responder in it's window.

Parameters
viewThe view to be made first responder. This view must be attached to a window.
Returns
true if the view is now the first responder, false if the current first responder rejected or the view rejected first responder status.

The documentation for this struct was generated from the following file: