Files
godot-docs/classes/class_tabcontainer.rst
Rémi Verschelde a02c0d3111 classref: Sync with current master branch
Also fixes Sphinx warnings and missing classes thanks to deefc2a63d
2017-10-14 15:40:29 +02:00

201 lines
11 KiB
ReStructuredText

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TabContainer.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_TabContainer:
TabContainer
============
**Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
**Category:** Core
Brief Description
-----------------
Tabbed Container.
Member Functions
----------------
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_tabs_visible<class_TabContainer_are_tabs_visible>` **(** **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_current_tab<class_TabContainer_get_current_tab>` **(** **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Control<class_control>` | :ref:`get_current_tab_control<class_TabContainer_get_current_tab_control>` **(** **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Popup<class_popup>` | :ref:`get_popup<class_TabContainer_get_popup>` **(** **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_previous_tab<class_TabContainer_get_previous_tab>` **(** **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tab_align<class_TabContainer_get_tab_align>` **(** **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Control<class_control>` | :ref:`get_tab_control<class_TabContainer_get_tab_control>` **(** :ref:`int<class_int>` idx **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tab_count<class_TabContainer_get_tab_count>` **(** **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_tab_disabled<class_TabContainer_get_tab_disabled>` **(** :ref:`int<class_int>` tab_idx **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture<class_texture>` | :ref:`get_tab_icon<class_TabContainer_get_tab_icon>` **(** :ref:`int<class_int>` tab_idx **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_string>` | :ref:`get_tab_title<class_TabContainer_get_tab_title>` **(** :ref:`int<class_int>` tab_idx **)** const |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_current_tab<class_TabContainer_set_current_tab>` **(** :ref:`int<class_int>` tab_idx **)** |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_popup<class_TabContainer_set_popup>` **(** :ref:`Node<class_node>` popup **)** |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_tab_align<class_TabContainer_set_tab_align>` **(** :ref:`int<class_int>` align **)** |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_tab_disabled<class_TabContainer_set_tab_disabled>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)** |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_tab_icon<class_TabContainer_set_tab_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_texture>` icon **)** |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_tab_title<class_TabContainer_set_tab_title>` **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_string>` title **)** |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_tabs_visible<class_TabContainer_set_tabs_visible>` **(** :ref:`bool<class_bool>` visible **)** |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
- **pre_popup_pressed** **(** **)**
- **tab_changed** **(** :ref:`int<class_int>` tab **)**
Emitted only when the current tab changes.
- **tab_selected** **(** :ref:`int<class_int>` tab **)**
Emitted when a tab is being selected, even if it is the same tab.
Member Variables
----------------
- :ref:`int<class_int>` **current_tab** - The current tab.
- :ref:`int<class_int>` **tab_align** - The alignment of all the tabs of the tab container. See the [code]ALIGN_*[/code] constants.
- :ref:`bool<class_bool>` **tabs_visible** - If [code]true[/code] all tabs that are children of the TabContainer will be visible.
Numeric Constants
-----------------
- **ALIGN_LEFT** = **0**
- **ALIGN_CENTER** = **1**
- **ALIGN_RIGHT** = **2**
Description
-----------
Tabbed Container. Contains several children controls, but shows only one at the same time. Clicking on the top tabs allows to change the currently visible one.
Children controls of this one automatically.
Member Function Description
---------------------------
.. _class_TabContainer_are_tabs_visible:
- :ref:`bool<class_bool>` **are_tabs_visible** **(** **)** const
Returns ``true`` if the tabs are visible.
.. _class_TabContainer_get_current_tab:
- :ref:`int<class_int>` **get_current_tab** **(** **)** const
Returns the current tab index that is being shown.
.. _class_TabContainer_get_current_tab_control:
- :ref:`Control<class_control>` **get_current_tab_control** **(** **)** const
.. _class_TabContainer_get_popup:
- :ref:`Popup<class_popup>` **get_popup** **(** **)** const
.. _class_TabContainer_get_previous_tab:
- :ref:`int<class_int>` **get_previous_tab** **(** **)** const
Returns the previous tab index that was being shown.
.. _class_TabContainer_get_tab_align:
- :ref:`int<class_int>` **get_tab_align** **(** **)** const
Returns the tab alignment.See the ALIGN\_\* constants.
.. _class_TabContainer_get_tab_control:
- :ref:`Control<class_control>` **get_tab_control** **(** :ref:`int<class_int>` idx **)** const
Returns the current tab control that is being shown.
.. _class_TabContainer_get_tab_count:
- :ref:`int<class_int>` **get_tab_count** **(** **)** const
Returns the amount of tabs.
.. _class_TabContainer_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_TabContainer_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_TabContainer_get_tab_title:
- :ref:`String<class_string>` **get_tab_title** **(** :ref:`int<class_int>` tab_idx **)** const
Returns the title for the tab at index ``tab_idx``. Tab titles are by default the children node name, but this can be overridden.
.. _class_TabContainer_set_current_tab:
- void **set_current_tab** **(** :ref:`int<class_int>` tab_idx **)**
Bring a tab (and the Control it represents) to the front, and hide the rest.
.. _class_TabContainer_set_popup:
- void **set_popup** **(** :ref:`Node<class_node>` popup **)**
.. _class_TabContainer_set_tab_align:
- void **set_tab_align** **(** :ref:`int<class_int>` align **)**
Set tab alignment, from the ALIGN\_\* enum. Moves tabs to the left, right or center.
.. _class_TabContainer_set_tab_disabled:
- void **set_tab_disabled** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)**
Set tab at index ``tab_idx`` disabled.
.. _class_TabContainer_set_tab_icon:
- void **set_tab_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_texture>` icon **)**
Set an icon for a tab at index ``tab_idx``.
.. _class_TabContainer_set_tab_title:
- void **set_tab_title** **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_string>` title **)**
Set a title for the tab at index ``tab_idx``. Tab titles are by default the children node name, but this can be overridden.
.. _class_TabContainer_set_tabs_visible:
- void **set_tabs_visible** **(** :ref:`bool<class_bool>` visible **)**
If ``true`` all the tabs will be visible.