:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the Tabs.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_Tabs: Tabs ==== **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Tabs Control. Properties ---------- +---------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :ref:`int` | :ref:`current_tab` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`drag_to_rearrange_enabled` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`scrolling_enabled` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :ref:`TabAlign` | :ref:`tab_align` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :ref:`CloseButtonDisplayPolicy` | :ref:`tab_close_display_policy` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------+ Methods ------- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_tab` **(** :ref:`String` title="", :ref:`Texture` icon=null **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`ensure_tab_visible` **(** :ref:`int` idx **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_offset_buttons_visible` **(** **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_select_with_rmb` **(** **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_tab_count` **(** **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_tab_disabled` **(** :ref:`int` tab_idx **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_tab_icon` **(** :ref:`int` tab_idx **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_tab_offset` **(** **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_tab_rect` **(** :ref:`int` tab_idx **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_tab_title` **(** :ref:`int` tab_idx **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_tabs_rearrange_group` **(** **)** const | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`move_tab` **(** :ref:`int` from, :ref:`int` to **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_tab` **(** :ref:`int` tab_idx **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_select_with_rmb` **(** :ref:`bool` enabled **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tab_disabled` **(** :ref:`int` tab_idx, :ref:`bool` disabled **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tab_icon` **(** :ref:`int` tab_idx, :ref:`Texture` icon **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tab_title` **(** :ref:`int` tab_idx, :ref:`String` title **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tabs_rearrange_group` **(** :ref:`int` group_id **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ Theme Properties ---------------- +---------------------------------+---------------------+ | :ref:`StyleBox` | button | +---------------------------------+---------------------+ | :ref:`StyleBox` | button_pressed | +---------------------------------+---------------------+ | :ref:`Texture` | close | +---------------------------------+---------------------+ | :ref:`Texture` | decrement | +---------------------------------+---------------------+ | :ref:`Texture` | decrement_highlight | +---------------------------------+---------------------+ | :ref:`Font` | font | +---------------------------------+---------------------+ | :ref:`Color` | font_color_bg | +---------------------------------+---------------------+ | :ref:`Color` | font_color_disabled | +---------------------------------+---------------------+ | :ref:`Color` | font_color_fg | +---------------------------------+---------------------+ | :ref:`int` | hseparation | +---------------------------------+---------------------+ | :ref:`Texture` | increment | +---------------------------------+---------------------+ | :ref:`Texture` | increment_highlight | +---------------------------------+---------------------+ | :ref:`int` | label_valign_bg | +---------------------------------+---------------------+ | :ref:`int` | label_valign_fg | +---------------------------------+---------------------+ | :ref:`StyleBox` | panel | +---------------------------------+---------------------+ | :ref:`StyleBox` | tab_bg | +---------------------------------+---------------------+ | :ref:`StyleBox` | tab_disabled | +---------------------------------+---------------------+ | :ref:`StyleBox` | tab_fg | +---------------------------------+---------------------+ | :ref:`int` | top_margin | +---------------------------------+---------------------+ Signals ------- .. _class_Tabs_signal_reposition_active_tab_request: - **reposition_active_tab_request** **(** :ref:`int` idx_to **)** ---- .. _class_Tabs_signal_right_button_pressed: - **right_button_pressed** **(** :ref:`int` tab **)** ---- .. _class_Tabs_signal_tab_changed: - **tab_changed** **(** :ref:`int` tab **)** ---- .. _class_Tabs_signal_tab_clicked: - **tab_clicked** **(** :ref:`int` tab **)** ---- .. _class_Tabs_signal_tab_close: - **tab_close** **(** :ref:`int` tab **)** ---- .. _class_Tabs_signal_tab_hover: - **tab_hover** **(** :ref:`int` tab **)** Enumerations ------------ .. _enum_Tabs_TabAlign: .. _class_Tabs_constant_ALIGN_LEFT: .. _class_Tabs_constant_ALIGN_CENTER: .. _class_Tabs_constant_ALIGN_RIGHT: .. _class_Tabs_constant_ALIGN_MAX: enum **TabAlign**: - **ALIGN_LEFT** = **0** --- Align the tabs to the left. - **ALIGN_CENTER** = **1** --- Align the tabs to the center. - **ALIGN_RIGHT** = **2** --- Align the tabs to the right. - **ALIGN_MAX** = **3** --- Represents the size of the :ref:`TabAlign` enum. ---- .. _enum_Tabs_CloseButtonDisplayPolicy: .. _class_Tabs_constant_CLOSE_BUTTON_SHOW_NEVER: .. _class_Tabs_constant_CLOSE_BUTTON_SHOW_ACTIVE_ONLY: .. _class_Tabs_constant_CLOSE_BUTTON_SHOW_ALWAYS: .. _class_Tabs_constant_CLOSE_BUTTON_MAX: enum **CloseButtonDisplayPolicy**: - **CLOSE_BUTTON_SHOW_NEVER** = **0** - **CLOSE_BUTTON_SHOW_ACTIVE_ONLY** = **1** - **CLOSE_BUTTON_SHOW_ALWAYS** = **2** - **CLOSE_BUTTON_MAX** = **3** --- Represents the size of the :ref:`CloseButtonDisplayPolicy` enum. Description ----------- Simple tabs control, similar to :ref:`TabContainer` but is only in charge of drawing tabs, not interact with children. Property Descriptions --------------------- .. _class_Tabs_property_current_tab: - :ref:`int` **current_tab** +----------+------------------------+ | *Setter* | set_current_tab(value) | +----------+------------------------+ | *Getter* | get_current_tab() | +----------+------------------------+ Select tab at index ``tab_idx``. ---- .. _class_Tabs_property_drag_to_rearrange_enabled: - :ref:`bool` **drag_to_rearrange_enabled** +----------+--------------------------------------+ | *Setter* | set_drag_to_rearrange_enabled(value) | +----------+--------------------------------------+ | *Getter* | get_drag_to_rearrange_enabled() | +----------+--------------------------------------+ If ``true``, tabs can be rearranged with mouse drag. ---- .. _class_Tabs_property_scrolling_enabled: - :ref:`bool` **scrolling_enabled** +----------+------------------------------+ | *Setter* | set_scrolling_enabled(value) | +----------+------------------------------+ | *Getter* | get_scrolling_enabled() | +----------+------------------------------+ ---- .. _class_Tabs_property_tab_align: - :ref:`TabAlign` **tab_align** +----------+----------------------+ | *Setter* | set_tab_align(value) | +----------+----------------------+ | *Getter* | get_tab_align() | +----------+----------------------+ The alignment of all tabs. See enum ``TabAlign`` constants for details. ---- .. _class_Tabs_property_tab_close_display_policy: - :ref:`CloseButtonDisplayPolicy` **tab_close_display_policy** +----------+-------------------------------------+ | *Setter* | set_tab_close_display_policy(value) | +----------+-------------------------------------+ | *Getter* | get_tab_close_display_policy() | +----------+-------------------------------------+ Method Descriptions ------------------- .. _class_Tabs_method_add_tab: - void **add_tab** **(** :ref:`String` title="", :ref:`Texture` icon=null **)** Adds a new tab. ---- .. _class_Tabs_method_ensure_tab_visible: - void **ensure_tab_visible** **(** :ref:`int` idx **)** Moves the Scroll view to make the tab visible. ---- .. _class_Tabs_method_get_offset_buttons_visible: - :ref:`bool` **get_offset_buttons_visible** **(** **)** const ---- .. _class_Tabs_method_get_select_with_rmb: - :ref:`bool` **get_select_with_rmb** **(** **)** const Returns ``true`` if select with right mouse button is enabled. ---- .. _class_Tabs_method_get_tab_count: - :ref:`int` **get_tab_count** **(** **)** const Returns the number of tabs. ---- .. _class_Tabs_method_get_tab_disabled: - :ref:`bool` **get_tab_disabled** **(** :ref:`int` tab_idx **)** const Returns ``true`` if the tab at index ``tab_idx`` is disabled. ---- .. _class_Tabs_method_get_tab_icon: - :ref:`Texture` **get_tab_icon** **(** :ref:`int` tab_idx **)** const Returns the :ref:`Texture` for the tab at index ``tab_idx`` or null if the tab has no :ref:`Texture`. ---- .. _class_Tabs_method_get_tab_offset: - :ref:`int` **get_tab_offset** **(** **)** const ---- .. _class_Tabs_method_get_tab_rect: - :ref:`Rect2` **get_tab_rect** **(** :ref:`int` tab_idx **)** const Returns tab :ref:`Rect2` with local position and size. ---- .. _class_Tabs_method_get_tab_title: - :ref:`String` **get_tab_title** **(** :ref:`int` tab_idx **)** const Returns the title of the tab at index ``tab_idx``. Tab titles default to the name of the indexed child node, but this can be overridden with :ref:`set_tab_title`. ---- .. _class_Tabs_method_get_tabs_rearrange_group: - :ref:`int` **get_tabs_rearrange_group** **(** **)** const Returns the ``Tabs`` rearrange group id. ---- .. _class_Tabs_method_move_tab: - void **move_tab** **(** :ref:`int` from, :ref:`int` to **)** Rearrange tab. ---- .. _class_Tabs_method_remove_tab: - void **remove_tab** **(** :ref:`int` tab_idx **)** Removes tab at index ``tab_idx`` ---- .. _class_Tabs_method_set_select_with_rmb: - void **set_select_with_rmb** **(** :ref:`bool` enabled **)** If ``true``, enables selecting a tab with right mouse button. ---- .. _class_Tabs_method_set_tab_disabled: - void **set_tab_disabled** **(** :ref:`int` tab_idx, :ref:`bool` disabled **)** If ``disabled`` is ``false``, hides the tab at index ``tab_idx``. Note that its title text will remain, unless also removed with :ref:`set_tab_title`. ---- .. _class_Tabs_method_set_tab_icon: - void **set_tab_icon** **(** :ref:`int` tab_idx, :ref:`Texture` icon **)** Sets an icon for the tab at index ``tab_idx``. ---- .. _class_Tabs_method_set_tab_title: - void **set_tab_title** **(** :ref:`int` tab_idx, :ref:`String` title **)** Sets a title for the tab at index ``tab_idx``. ---- .. _class_Tabs_method_set_tabs_rearrange_group: - void **set_tabs_rearrange_group** **(** :ref:`int` group_id **)** Defines rearrange group id, choose for each ``Tabs`` the same value to enable tab drag between ``Tabs``. Enable drag with ``set_drag_to_rearrange_enabled(true)``.