Widget

Inherited: None

Description

The Widget class serves as the base class for all user interface objects, providing basic functionality for handling updates, drawing, and interaction. Internal methods are marked as internal and are intended for use within the framework rather than by external code.

Public Methods

void

addClass (const std::string & name)

void

applyStyle ()

void

boundChanged (const Vector2 & size)

std::list<Widget *>

childWidgets () const

const std::list &

classes () const

void

lower ()

Widget *

parentWidget ()

void

raise ()

RectTransform *

rectTransform () const

std::string

style () const

Static Methods

Widget *

focusWidget ()

Methods Description

void Widget::addClass (std::string & name)

Adds a stylesheet class name attached to this widget.


void Widget::applyStyle ()

Applies style settings assigned to widget.


void Widget::boundChanged (Vector2 & size)

Callback to respond to changes in the widget’s size.


std::list<Widget *> Widget::childWidgets () const

Returns a list of child widgets;


const std::list & Widget::classes () const

Returns a list of stylesheet class names attached to this widget.


Widget * Widget::focusWidget ()

Returns the application widget that has the keyboard input focus, or nullptr if no widget in this application has the focus.


void Widget::lower ()

Lowers the widget to the bottom of the widget’s stack.

See also raise().


Widget * Widget::parentWidget ()

Returns the parent Widget.


void Widget::raise ()

Raises this widget to the top of the widget’s stack.

See also lower().


RectTransform * Widget::rectTransform () const

Returns RectTransform component attached to parent Actor.


std::string Widget::style () const

Sets a textual description of widget style.