.. This file is auto-generated by //tools:generate_doc. Please do not edit directly

VirtualWidget
=============
.. class:: VirtualWidget

   Represents a virtual UI widget.

   This class provides an abstraction for a UI widget, supporting properties such as text, coordinates,
   dimensions, visibility, focus state, and parent/child relationships.

   .. method:: __repr__() -> str
   .. method:: __str__() -> str
   .. method:: add_child(child) -> None

     Add a child widget to this widget.

   Note: This does not automatically set the child widget's parent. To preserve tree structure,
   you should also call set_parent() on the child widget to assign this widget as its parent.

   :param child: Child widget.

   .. method:: get_child(index) -> VirtualWidget

     Get the child widget at the given index (starting from 0).

   Throws an out_of_range exception if there are not that many children.

   :param index: Index of the child widget.
   :return: Child widget at the given index.

   .. method:: get_children() -> list[VirtualWidget]

     Get all children of this widget in the tree.

   :return: List of all children widgets.

   .. method:: get_height() -> int

     Get the height of the current widget.

   :return: Height of the widget.

   .. method:: get_help_text() -> str

     Get help text.

   Help text is generally the secondary text content in a widget.
   When you hover the cursor over widgets, if a tooltip pops up,
   the tooltip content will be considered a help text.

   :return: Help text.

   .. method:: get_native_name() -> str

     Get name of the native widget this virtual widget is mapped from.

   :return: Native widget name.

   .. method:: get_parent() -> VirtualWidget

     Get the parent widget of the current widget.

   :return: Parent widget.

   .. method:: get_title_text() -> str

     Get title text.

   Title text is a string that represents the primary text content of the widget.
   - It can be the content string on the button, which says "Click me"
   - It can be the string that a text input is displaying (if any)

   :return: Title text string.

   .. method:: get_widget_name() -> str

     Get the name of the current virtual widget in UpperCamelCase.

   Examples: "VirtualButtonWidget", "VirtualTextWidget", etc.

   :return: Current virtual widget name.

   .. method:: get_width() -> int

     Get the width of the current widget.

   :return: Width of the widget.

   .. method:: get_x() -> int

     Get the X coordinate of the top-left corner of the widget relative to the screen.

   The top-left corner of the screen is considered the origin.

   :return: X coordinate.

   .. method:: get_y() -> int

     Get the Y coordinate of the top-left corner of the widget relative to the screen.

   The top-left corner of the screen is considered the origin.

   :return: Y coordinate.

   .. method:: is_focused() -> bool

     Get whether the current widget is focused.

   :return: True if focused, False otherwise.

   .. method:: is_visible() -> bool

     Get whether the current widget is visible to the user.

   :return: True if visible, False otherwise.

   .. method:: set_focused(focused) -> None

     Set whether the current widget is focused.

   :param focused: True if focused, False otherwise.

   .. method:: set_height(height) -> None

     Set the height of the current widget.

   :param height: Height of the widget.

   .. method:: set_help_text(help_text) -> None

     Set help text.

   See also: get_help_text()

   :param help_text: Help text string.

   .. method:: set_native_name(native_name) -> None

     Set native widget name.

   See also: get_native_name()

   :param native_name: Name of the native widget this virtual widget is mapped from.

   .. method:: set_parent(parent) -> None

     Set the parent widget of the current widget.

   :param parent: Parent widget.

   .. method:: set_title_text(title_text) -> None

     Set title text.

   See also: get_title_text()

   :param title_text: Title text string.

   .. method:: set_visible(visible) -> None

     Set whether the current widget is visible to the user.

   :param visible: True if visible, False otherwise.

   .. method:: set_width(width) -> None

     Set the width of the current widget.

   :param width: Width of the widget.

   .. method:: set_x(x_coord) -> None

     Set the X coordinate of the top-left corner of the widget.

   :param x_coord: X coordinate.

   .. method:: set_y(y_coord) -> None

     Set the Y coordinate of the top-left corner of the widget.

   :param y_coord: Y coordinate.
