2
0

class_tabcontainer.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the TabContainer.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_TabContainer:
  5. TabContainer
  6. ============
  7. **Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Tabbed Container.
  12. Member Functions
  13. ----------------
  14. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`are_tabs_visible<class_TabContainer_are_tabs_visible>` **(** **)** const |
  16. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_current_tab<class_TabContainer_get_current_tab>` **(** **)** const |
  18. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Control<class_control>` | :ref:`get_current_tab_control<class_TabContainer_get_current_tab_control>` **(** **)** const |
  20. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Popup<class_popup>` | :ref:`get_popup<class_TabContainer_get_popup>` **(** **)** const |
  22. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_previous_tab<class_TabContainer_get_previous_tab>` **(** **)** const |
  24. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`get_tab_align<class_TabContainer_get_tab_align>` **(** **)** const |
  26. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Control<class_control>` | :ref:`get_tab_control<class_TabContainer_get_tab_control>` **(** :ref:`int<class_int>` idx **)** const |
  28. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_tab_count<class_TabContainer_get_tab_count>` **(** **)** const |
  30. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`get_tab_disabled<class_TabContainer_get_tab_disabled>` **(** :ref:`int<class_int>` tab_idx **)** const |
  32. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Texture<class_texture>` | :ref:`get_tab_icon<class_TabContainer_get_tab_icon>` **(** :ref:`int<class_int>` tab_idx **)** const |
  34. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`String<class_string>` | :ref:`get_tab_title<class_TabContainer_get_tab_title>` **(** :ref:`int<class_int>` tab_idx **)** const |
  36. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_current_tab<class_TabContainer_set_current_tab>` **(** :ref:`int<class_int>` tab_idx **)** |
  38. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_popup<class_TabContainer_set_popup>` **(** :ref:`Node<class_node>` popup **)** |
  40. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_tab_align<class_TabContainer_set_tab_align>` **(** :ref:`int<class_int>` align **)** |
  42. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_tab_disabled<class_TabContainer_set_tab_disabled>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)** |
  44. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`set_tab_icon<class_TabContainer_set_tab_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_texture>` icon **)** |
  46. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`set_tab_title<class_TabContainer_set_tab_title>` **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_string>` title **)** |
  48. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`set_tabs_visible<class_TabContainer_set_tabs_visible>` **(** :ref:`bool<class_bool>` visible **)** |
  50. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  51. Signals
  52. -------
  53. - **pre_popup_pressed** **(** **)**
  54. - **tab_changed** **(** :ref:`int<class_int>` tab **)**
  55. Emitted only when the current tab changes.
  56. - **tab_selected** **(** :ref:`int<class_int>` tab **)**
  57. Emitted when a tab is being selected, even if it is the same tab.
  58. Member Variables
  59. ----------------
  60. - :ref:`int<class_int>` **current_tab** - The current tab.
  61. - :ref:`int<class_int>` **tab_align** - The alignment of all the tabs of the tab container. See the ``ALIGN\_\*`` constants.
  62. - :ref:`bool<class_bool>` **tabs_visible** - If ``true`` all tabs that are children of the TabContainer will be visible.
  63. Numeric Constants
  64. -----------------
  65. - **ALIGN_LEFT** = **0**
  66. - **ALIGN_CENTER** = **1**
  67. - **ALIGN_RIGHT** = **2**
  68. Description
  69. -----------
  70. 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.
  71. Children controls of this one automatically.
  72. Member Function Description
  73. ---------------------------
  74. .. _class_TabContainer_are_tabs_visible:
  75. - :ref:`bool<class_bool>` **are_tabs_visible** **(** **)** const
  76. Returns ``true`` if the tabs are visible.
  77. .. _class_TabContainer_get_current_tab:
  78. - :ref:`int<class_int>` **get_current_tab** **(** **)** const
  79. Returns the current tab index that is being shown.
  80. .. _class_TabContainer_get_current_tab_control:
  81. - :ref:`Control<class_control>` **get_current_tab_control** **(** **)** const
  82. .. _class_TabContainer_get_popup:
  83. - :ref:`Popup<class_popup>` **get_popup** **(** **)** const
  84. .. _class_TabContainer_get_previous_tab:
  85. - :ref:`int<class_int>` **get_previous_tab** **(** **)** const
  86. Returns the previous tab index that was being shown.
  87. .. _class_TabContainer_get_tab_align:
  88. - :ref:`int<class_int>` **get_tab_align** **(** **)** const
  89. Returns the tab alignment.See the ALIGN\_\* constants.
  90. .. _class_TabContainer_get_tab_control:
  91. - :ref:`Control<class_control>` **get_tab_control** **(** :ref:`int<class_int>` idx **)** const
  92. Returns the current tab control that is being shown.
  93. .. _class_TabContainer_get_tab_count:
  94. - :ref:`int<class_int>` **get_tab_count** **(** **)** const
  95. Returns the amount of tabs.
  96. .. _class_TabContainer_get_tab_disabled:
  97. - :ref:`bool<class_bool>` **get_tab_disabled** **(** :ref:`int<class_int>` tab_idx **)** const
  98. Returns ``true`` if the tab at index ``tab_idx`` is disabled.
  99. .. _class_TabContainer_get_tab_icon:
  100. - :ref:`Texture<class_texture>` **get_tab_icon** **(** :ref:`int<class_int>` tab_idx **)** const
  101. Returns the :ref:`Texture<class_texture>` for the tab at index ``tab_idx`` or null if the tab has no :ref:`Texture<class_texture>`.
  102. .. _class_TabContainer_get_tab_title:
  103. - :ref:`String<class_string>` **get_tab_title** **(** :ref:`int<class_int>` tab_idx **)** const
  104. Returns the title for the tab at index ``tab_idx``. Tab titles are by default the children node name, but this can be overridden.
  105. .. _class_TabContainer_set_current_tab:
  106. - void **set_current_tab** **(** :ref:`int<class_int>` tab_idx **)**
  107. Bring a tab (and the Control it represents) to the front, and hide the rest.
  108. .. _class_TabContainer_set_popup:
  109. - void **set_popup** **(** :ref:`Node<class_node>` popup **)**
  110. .. _class_TabContainer_set_tab_align:
  111. - void **set_tab_align** **(** :ref:`int<class_int>` align **)**
  112. Set tab alignment, from the ALIGN\_\* enum. Moves tabs to the left, right or center.
  113. .. _class_TabContainer_set_tab_disabled:
  114. - void **set_tab_disabled** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)**
  115. Set tab at index ``tab_idx`` disabled.
  116. .. _class_TabContainer_set_tab_icon:
  117. - void **set_tab_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_texture>` icon **)**
  118. Set an icon for a tab at index ``tab_idx``.
  119. .. _class_TabContainer_set_tab_title:
  120. - void **set_tab_title** **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_string>` title **)**
  121. Set a title for the tab at index ``tab_idx``. Tab titles are by default the children node name, but this can be overridden.
  122. .. _class_TabContainer_set_tabs_visible:
  123. - void **set_tabs_visible** **(** :ref:`bool<class_bool>` visible **)**
  124. If ``true`` all the tabs will be visible.