Widget¶
Inherited: Component
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 TString & name) |
void |
applyStyle () |
void |
boundChanged (const Vector2 & size) |
Canvas * |
canvas () |
std::list<Widget *> & |
childWidgets () |
const StringList |
classes () const |
bool |
isSubWidget () const |
void |
lower () |
Widget * |
parentWidget () const |
void |
raise () |
void |
setEnabled (bool enabled) |
style () const |
|
Widget * |
subWidget (const TString & name) const |
Static Methods¶
Widget * |
focusWidget () |
Methods Description¶
void Widget::addClass (TString & 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.
Canvas * Widget::canvas ()
Returns the Canvas that is the root node in the given Widget hierarchy.
std::list<Widget *> & Widget::childWidgets ()
Returns a list of child widgets;
const StringList 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.
bool Widget::isSubWidget () const
Returns true if widget is a part of complex widget; otherwise returns false.
void Widget::lower ()
Lowers the widget to the bottom of the widget’s stack.
See also raise().
Widget * Widget::parentWidget () const
Returns the parent Widget.
void Widget::raise ()
Raises this widget to the top of the widget’s stack.
See also lower().
RectTransform * Widget::rectTransform ()
Returns RectTransform component attached to parent Actor.
void Widget::setEnabled (bool enabled)
Reimplements: Component::setEnabled(bool enabled).
Sets current state of widget to enabled or disabled.
TString Widget::style () const
Returns a textual description of widget style.
Return a sub widget (a part of more complex widget) with specified name.