.. _api_Widget: Widget ====== Inherited: :ref:`Component` .. _api_Widget_description: 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. .. _api_Widget_public: Public Methods -------------- +--------------------------------------------+--------------------------------------------------------------------+ | void | :ref:`addClass` (const TString & name) | +--------------------------------------------+--------------------------------------------------------------------+ | void | :ref:`applyStyle` () | +--------------------------------------------+--------------------------------------------------------------------+ | void | :ref:`boundChanged` (const Vector2 & size) | +--------------------------------------------+--------------------------------------------------------------------+ | :ref:`Canvas` * | :ref:`canvas` () | +--------------------------------------------+--------------------------------------------------------------------+ | std::list>` & | :ref:`childWidgets` () | +--------------------------------------------+--------------------------------------------------------------------+ | const StringList | :ref:`classes` () const | +--------------------------------------------+--------------------------------------------------------------------+ | bool | :ref:`isSubWidget` () const | +--------------------------------------------+--------------------------------------------------------------------+ | void | :ref:`lower` () | +--------------------------------------------+--------------------------------------------------------------------+ | :ref:`Widget` * | :ref:`parentWidget` () const | +--------------------------------------------+--------------------------------------------------------------------+ | void | :ref:`raise` () | +--------------------------------------------+--------------------------------------------------------------------+ | :ref:`RectTransform` * | :ref:`rectTransform` () | +--------------------------------------------+--------------------------------------------------------------------+ | void | :ref:`setEnabled` (bool enabled) | +--------------------------------------------+--------------------------------------------------------------------+ | :ref:`TString` | :ref:`style` () const | +--------------------------------------------+--------------------------------------------------------------------+ | :ref:`Widget` * | :ref:`subWidget` (const TString & name) const | +--------------------------------------------+--------------------------------------------------------------------+ .. _api_Widget_static: Static Methods -------------- +------------------------------+--------------------------------------------+ | :ref:`Widget` * | :ref:`focusWidget` () | +------------------------------+--------------------------------------------+ .. _api_Widget_methods: Methods Description ------------------- .. _api_Widget_fe19cd82: void **Widget::addClass** (:ref:`TString` & *name*) Adds a stylesheet class *name* attached to this widget. ---- .. _api_Widget_9e73c625: void **Widget::applyStyle** () Applies style settings assigned to widget. ---- .. _api_Widget_83c957b6: void **Widget::boundChanged** (:ref:`Vector2` & *size*) Callback to respond to changes in the widget's size. ---- .. _api_Widget_3856afc9: :ref:`Canvas` * **Widget::canvas** () Returns the Canvas that is the root node in the given Widget hierarchy. ---- .. _api_Widget_6a31fd75: std::list>` & **Widget::childWidgets** () Returns a list of child widgets; ---- .. _api_Widget_862ca930: const StringList **Widget::classes** () const Returns a list of stylesheet class names attached to this widget. ---- .. _api_Widget_549f32bd: :ref:`Widget` * **Widget::focusWidget** () Returns the application widget that has the keyboard input focus, or nullptr if no widget in this application has the focus. ---- .. _api_Widget_3b8172ce: bool **Widget::isSubWidget** () const Returns true if widget is a part of complex widget; otherwise returns false. ---- .. _api_Widget_f4e51a60: void **Widget::lower** () Lowers the widget to the bottom of the widget's stack. **See also** raise(). ---- .. _api_Widget_8792b163: :ref:`Widget` * **Widget::parentWidget** () const Returns the parent Widget. ---- .. _api_Widget_58194e60: void **Widget::raise** () Raises this widget to the top of the widget's stack. **See also** lower(). ---- .. _api_Widget_0f4127ca: :ref:`RectTransform` * **Widget::rectTransform** () Returns RectTransform component attached to parent Actor. ---- .. _api_Widget_7fb924a6: void **Widget::setEnabled** (bool *enabled*) Reimplements: Component::setEnabled(bool enabled). Sets current state of widget to *enabled* or disabled. ---- .. _api_Widget_c5e37694: :ref:`TString` **Widget::style** () const Returns a textual description of widget style. ---- .. _api_Widget_c30b7a52: :ref:`Widget` * **Widget::subWidget** (:ref:`TString` & *name*) const Return a sub widget (a part of more complex widget) with specified name.