123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- .. 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/<name>/doc_classes.
- .. _class_Tabs:
- Tabs
- ====
- **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Category:** Core
- Brief Description
- -----------------
- Tabs Control.
- Properties
- ----------
- +---------------------------------------------------------------------+------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`current_tab<class_Tabs_current_tab>` |
- +---------------------------------------------------------------------+------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`drag_to_rearrange_enabled<class_Tabs_drag_to_rearrange_enabled>` |
- +---------------------------------------------------------------------+------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`scrolling_enabled<class_Tabs_scrolling_enabled>` |
- +---------------------------------------------------------------------+------------------------------------------------------------------------+
- | :ref:`TabAlign<enum_Tabs_TabAlign>` | :ref:`tab_align<class_Tabs_tab_align>` |
- +---------------------------------------------------------------------+------------------------------------------------------------------------+
- | :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` | :ref:`tab_close_display_policy<class_Tabs_tab_close_display_policy>` |
- +---------------------------------------------------------------------+------------------------------------------------------------------------+
- Methods
- -------
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_tab<class_Tabs_add_tab>` **(** :ref:`String<class_String>` title="", :ref:`Texture<class_Texture>` icon=null **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`ensure_tab_visible<class_Tabs_ensure_tab_visible>` **(** :ref:`int<class_int>` idx **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`get_offset_buttons_visible<class_Tabs_get_offset_buttons_visible>` **(** **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`get_select_with_rmb<class_Tabs_get_select_with_rmb>` **(** **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_tab_count<class_Tabs_get_tab_count>` **(** **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`get_tab_disabled<class_Tabs_get_tab_disabled>` **(** :ref:`int<class_int>` tab_idx **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`get_tab_icon<class_Tabs_get_tab_icon>` **(** :ref:`int<class_int>` tab_idx **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_tab_offset<class_Tabs_get_tab_offset>` **(** **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Rect2<class_Rect2>` | :ref:`get_tab_rect<class_Tabs_get_tab_rect>` **(** :ref:`int<class_int>` tab_idx **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_tab_title<class_Tabs_get_tab_title>` **(** :ref:`int<class_int>` tab_idx **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_tabs_rearrange_group<class_Tabs_get_tabs_rearrange_group>` **(** **)** const |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`move_tab<class_Tabs_move_tab>` **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`remove_tab<class_Tabs_remove_tab>` **(** :ref:`int<class_int>` tab_idx **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_select_with_rmb<class_Tabs_set_select_with_rmb>` **(** :ref:`bool<class_bool>` enabled **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_disabled<class_Tabs_set_tab_disabled>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_icon<class_Tabs_set_tab_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_title<class_Tabs_set_tab_title>` **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tabs_rearrange_group<class_Tabs_set_tabs_rearrange_group>` **(** :ref:`int<class_int>` group_id **)** |
- +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- Theme Properties
- ----------------
- +---------------------------------+------------------------------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`button<class_Tabs_button>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`button_pressed<class_Tabs_button_pressed>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`close<class_Tabs_close>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`decrement<class_Tabs_decrement>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`decrement_highlight<class_Tabs_decrement_highlight>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Font<class_Font>` | :ref:`font<class_Tabs_font>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_color_bg<class_Tabs_font_color_bg>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_Tabs_font_color_disabled>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_color_fg<class_Tabs_font_color_fg>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`hseparation<class_Tabs_hseparation>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`increment<class_Tabs_increment>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`increment_highlight<class_Tabs_increment_highlight>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`label_valign_bg<class_Tabs_label_valign_bg>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`label_valign_fg<class_Tabs_label_valign_fg>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_Tabs_panel>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_bg<class_Tabs_tab_bg>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_fg<class_Tabs_tab_fg>` |
- +---------------------------------+------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`top_margin<class_Tabs_top_margin>` |
- +---------------------------------+------------------------------------------------------------+
- Signals
- -------
- .. _class_Tabs_reposition_active_tab_request:
- - **reposition_active_tab_request** **(** :ref:`int<class_int>` idx_to **)**
- .. _class_Tabs_right_button_pressed:
- - **right_button_pressed** **(** :ref:`int<class_int>` tab **)**
- .. _class_Tabs_tab_changed:
- - **tab_changed** **(** :ref:`int<class_int>` tab **)**
- .. _class_Tabs_tab_clicked:
- - **tab_clicked** **(** :ref:`int<class_int>` tab **)**
- .. _class_Tabs_tab_close:
- - **tab_close** **(** :ref:`int<class_int>` tab **)**
- .. _class_Tabs_tab_hover:
- - **tab_hover** **(** :ref:`int<class_int>` tab **)**
- Enumerations
- ------------
- .. _enum_Tabs_TabAlign:
- 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**
- .. _enum_Tabs_CloseButtonDisplayPolicy:
- enum **CloseButtonDisplayPolicy**:
- - **CLOSE_BUTTON_SHOW_NEVER** = **0**
- - **CLOSE_BUTTON_SHOW_ACTIVE_ONLY** = **1**
- - **CLOSE_BUTTON_SHOW_ALWAYS** = **2**
- - **CLOSE_BUTTON_MAX** = **3**
- Description
- -----------
- Simple tabs control, similar to :ref:`TabContainer<class_TabContainer>` but is only in charge of drawing tabs, not interact with children.
- Property Descriptions
- ---------------------
- .. _class_Tabs_current_tab:
- - :ref:`int<class_int>` **current_tab**
- +----------+------------------------+
- | *Setter* | set_current_tab(value) |
- +----------+------------------------+
- | *Getter* | get_current_tab() |
- +----------+------------------------+
- Select tab at index ``tab_idx``.
- .. _class_Tabs_drag_to_rearrange_enabled:
- - :ref:`bool<class_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_scrolling_enabled:
- - :ref:`bool<class_bool>` **scrolling_enabled**
- +----------+------------------------------+
- | *Setter* | set_scrolling_enabled(value) |
- +----------+------------------------------+
- | *Getter* | get_scrolling_enabled() |
- +----------+------------------------------+
- .. _class_Tabs_tab_align:
- - :ref:`TabAlign<enum_Tabs_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_tab_close_display_policy:
- - :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` **tab_close_display_policy**
- +----------+-------------------------------------+
- | *Setter* | set_tab_close_display_policy(value) |
- +----------+-------------------------------------+
- | *Getter* | get_tab_close_display_policy() |
- +----------+-------------------------------------+
- Method Descriptions
- -------------------
- .. _class_Tabs_add_tab:
- - void **add_tab** **(** :ref:`String<class_String>` title="", :ref:`Texture<class_Texture>` icon=null **)**
- Adds a new tab.
- .. _class_Tabs_ensure_tab_visible:
- - void **ensure_tab_visible** **(** :ref:`int<class_int>` idx **)**
- Moves the Scroll view to make the tab visible.
- .. _class_Tabs_get_offset_buttons_visible:
- - :ref:`bool<class_bool>` **get_offset_buttons_visible** **(** **)** const
- .. _class_Tabs_get_select_with_rmb:
- - :ref:`bool<class_bool>` **get_select_with_rmb** **(** **)** const
- Returns ``true`` if select with right mouse button is enabled.
- .. _class_Tabs_get_tab_count:
- - :ref:`int<class_int>` **get_tab_count** **(** **)** const
- Returns the number of tabs.
- .. _class_Tabs_get_tab_disabled:
- - :ref:`bool<class_bool>` **get_tab_disabled** **(** :ref:`int<class_int>` tab_idx **)** const
- Returns ``true`` if the tab at index ``tab_idx`` is disabled.
- .. _class_Tabs_get_tab_icon:
- - :ref:`Texture<class_Texture>` **get_tab_icon** **(** :ref:`int<class_int>` tab_idx **)** const
- Returns the :ref:`Texture<class_Texture>` for the tab at index ``tab_idx`` or null if the tab has no :ref:`Texture<class_Texture>`.
- .. _class_Tabs_get_tab_offset:
- - :ref:`int<class_int>` **get_tab_offset** **(** **)** const
- .. _class_Tabs_get_tab_rect:
- - :ref:`Rect2<class_Rect2>` **get_tab_rect** **(** :ref:`int<class_int>` tab_idx **)** const
- Returns tab :ref:`Rect2<class_Rect2>` with local position and size.
- .. _class_Tabs_get_tab_title:
- - :ref:`String<class_String>` **get_tab_title** **(** :ref:`int<class_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_set_tab_title>`.
- .. _class_Tabs_get_tabs_rearrange_group:
- - :ref:`int<class_int>` **get_tabs_rearrange_group** **(** **)** const
- Returns the ``Tabs`` rearrange group id.
- .. _class_Tabs_move_tab:
- - void **move_tab** **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)**
- Rearrange tab.
- .. _class_Tabs_remove_tab:
- - void **remove_tab** **(** :ref:`int<class_int>` tab_idx **)**
- Removes tab at index ``tab_idx``
- .. _class_Tabs_set_select_with_rmb:
- - void **set_select_with_rmb** **(** :ref:`bool<class_bool>` enabled **)**
- If ``true``, enables selecting a tab with right mouse button.
- .. _class_Tabs_set_tab_disabled:
- - void **set_tab_disabled** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_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_set_tab_title>`.
- .. _class_Tabs_set_tab_icon:
- - void **set_tab_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)**
- Sets an icon for the tab at index ``tab_idx``.
- .. _class_Tabs_set_tab_title:
- - void **set_tab_title** **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)**
- Sets a title for the tab at index ``tab_idx``.
- .. _class_Tabs_set_tabs_rearrange_group:
- - void **set_tabs_rearrange_group** **(** :ref:`int<class_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)``.
|