class_tabcontainer.rst 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/TabContainer.xml.
  6. .. _class_TabContainer:
  7. TabContainer
  8. ============
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Tabbed container.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Arranges :ref:`Control<class_Control>` children into a tabbed view, creating a tab for each one. The active tab's corresponding :ref:`Control<class_Control>` has its ``visible`` property set to ``true``, and all other children's to ``false``.
  15. Ignores non-:ref:`Control<class_Control>` children.
  16. \ **Note:** The drawing of the clickable tabs themselves is handled by this node. Adding :ref:`Tabs<class_Tabs>` as children is not needed.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`GUI containers <../tutorials/ui/gui_containers>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`all_tabs_in_front<class_TabContainer_property_all_tabs_in_front>` | ``false`` |
  28. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`int<class_int>` | :ref:`current_tab<class_TabContainer_property_current_tab>` | ``0`` |
  30. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>` | ``false`` |
  32. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`TabAlign<enum_TabContainer_TabAlign>` | :ref:`tab_align<class_TabContainer_property_tab_align>` | ``1`` |
  34. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`tabs_visible<class_TabContainer_property_tabs_visible>` | ``true`` |
  36. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`use_hidden_tabs_for_min_size<class_TabContainer_property_use_hidden_tabs_for_min_size>` | ``false`` |
  38. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  39. .. rst-class:: classref-reftable-group
  40. Methods
  41. -------
  42. .. table::
  43. :widths: auto
  44. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Control<class_Control>` | :ref:`get_current_tab_control<class_TabContainer_method_get_current_tab_control>` **(** **)** |const| |
  46. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Popup<class_Popup>` | :ref:`get_popup<class_TabContainer_method_get_popup>` **(** **)** |const| |
  48. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_previous_tab<class_TabContainer_method_get_previous_tab>` **(** **)** |const| |
  50. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`Control<class_Control>` | :ref:`get_tab_control<class_TabContainer_method_get_tab_control>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  52. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`get_tab_count<class_TabContainer_method_get_tab_count>` **(** **)** |const| |
  54. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`get_tab_disabled<class_TabContainer_method_get_tab_disabled>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  56. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`get_tab_hidden<class_TabContainer_method_get_tab_hidden>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  58. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Texture<class_Texture>` | :ref:`get_tab_icon<class_TabContainer_method_get_tab_icon>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  60. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_tab_idx_at_point<class_TabContainer_method_get_tab_idx_at_point>` **(** :ref:`Vector2<class_Vector2>` point **)** |const| |
  62. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Variant<class_Variant>` | :ref:`get_tab_metadata<class_TabContainer_method_get_tab_metadata>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  64. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`String<class_String>` | :ref:`get_tab_title<class_TabContainer_method_get_tab_title>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  66. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`int<class_int>` | :ref:`get_tabs_rearrange_group<class_TabContainer_method_get_tabs_rearrange_group>` **(** **)** |const| |
  68. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`set_popup<class_TabContainer_method_set_popup>` **(** :ref:`Node<class_Node>` popup **)** |
  70. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`set_tab_disabled<class_TabContainer_method_set_tab_disabled>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)** |
  72. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`set_tab_hidden<class_TabContainer_method_set_tab_hidden>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` hidden **)** |
  74. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_tab_icon<class_TabContainer_method_set_tab_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)** |
  76. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_tab_metadata<class_TabContainer_method_set_tab_metadata>` **(** :ref:`int<class_int>` tab_idx, :ref:`Variant<class_Variant>` metadata **)** |
  78. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`set_tab_title<class_TabContainer_method_set_tab_title>` **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)** |
  80. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`set_tabs_rearrange_group<class_TabContainer_method_set_tabs_rearrange_group>` **(** :ref:`int<class_int>` group_id **)** |
  82. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. .. rst-class:: classref-reftable-group
  84. Theme Properties
  85. ----------------
  86. .. table::
  87. :widths: auto
  88. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`font_color_bg<class_TabContainer_theme_color_font_color_bg>` | ``Color( 0.69, 0.69, 0.69, 1 )`` |
  90. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  91. | :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_TabContainer_theme_color_font_color_disabled>` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` |
  92. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  93. | :ref:`Color<class_Color>` | :ref:`font_color_fg<class_TabContainer_theme_color_font_color_fg>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  94. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  95. | :ref:`int<class_int>` | :ref:`hseparation<class_TabContainer_theme_constant_hseparation>` | ``4`` |
  96. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  97. | :ref:`int<class_int>` | :ref:`label_valign_bg<class_TabContainer_theme_constant_label_valign_bg>` | ``2`` |
  98. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  99. | :ref:`int<class_int>` | :ref:`label_valign_fg<class_TabContainer_theme_constant_label_valign_fg>` | ``0`` |
  100. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  101. | :ref:`int<class_int>` | :ref:`side_margin<class_TabContainer_theme_constant_side_margin>` | ``8`` |
  102. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  103. | :ref:`int<class_int>` | :ref:`top_margin<class_TabContainer_theme_constant_top_margin>` | ``24`` |
  104. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  105. | :ref:`Font<class_Font>` | :ref:`font<class_TabContainer_theme_font_font>` | |
  106. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  107. | :ref:`Texture<class_Texture>` | :ref:`decrement<class_TabContainer_theme_icon_decrement>` | |
  108. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  109. | :ref:`Texture<class_Texture>` | :ref:`decrement_highlight<class_TabContainer_theme_icon_decrement_highlight>` | |
  110. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  111. | :ref:`Texture<class_Texture>` | :ref:`increment<class_TabContainer_theme_icon_increment>` | |
  112. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  113. | :ref:`Texture<class_Texture>` | :ref:`increment_highlight<class_TabContainer_theme_icon_increment_highlight>` | |
  114. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  115. | :ref:`Texture<class_Texture>` | :ref:`menu<class_TabContainer_theme_icon_menu>` | |
  116. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  117. | :ref:`Texture<class_Texture>` | :ref:`menu_highlight<class_TabContainer_theme_icon_menu_highlight>` | |
  118. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  119. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_TabContainer_theme_style_panel>` | |
  120. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  121. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_bg<class_TabContainer_theme_style_tab_bg>` | |
  122. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  123. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_disabled<class_TabContainer_theme_style_tab_disabled>` | |
  124. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  125. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_fg<class_TabContainer_theme_style_tab_fg>` | |
  126. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  127. .. rst-class:: classref-section-separator
  128. ----
  129. .. rst-class:: classref-descriptions-group
  130. Signals
  131. -------
  132. .. _class_TabContainer_signal_pre_popup_pressed:
  133. .. rst-class:: classref-signal
  134. **pre_popup_pressed** **(** **)**
  135. Emitted when the **TabContainer**'s :ref:`Popup<class_Popup>` button is clicked. See :ref:`set_popup<class_TabContainer_method_set_popup>` for details.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_TabContainer_signal_tab_changed:
  139. .. rst-class:: classref-signal
  140. **tab_changed** **(** :ref:`int<class_int>` tab **)**
  141. Emitted when switching to another tab.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_TabContainer_signal_tab_selected:
  145. .. rst-class:: classref-signal
  146. **tab_selected** **(** :ref:`int<class_int>` tab **)**
  147. Emitted when a tab is selected, even if it is the current tab.
  148. .. rst-class:: classref-section-separator
  149. ----
  150. .. rst-class:: classref-descriptions-group
  151. Enumerations
  152. ------------
  153. .. _enum_TabContainer_TabAlign:
  154. .. rst-class:: classref-enumeration
  155. enum **TabAlign**:
  156. .. _class_TabContainer_constant_ALIGN_LEFT:
  157. .. rst-class:: classref-enumeration-constant
  158. :ref:`TabAlign<enum_TabContainer_TabAlign>` **ALIGN_LEFT** = ``0``
  159. Align the tabs to the left.
  160. .. _class_TabContainer_constant_ALIGN_CENTER:
  161. .. rst-class:: classref-enumeration-constant
  162. :ref:`TabAlign<enum_TabContainer_TabAlign>` **ALIGN_CENTER** = ``1``
  163. Align the tabs to the center.
  164. .. _class_TabContainer_constant_ALIGN_RIGHT:
  165. .. rst-class:: classref-enumeration-constant
  166. :ref:`TabAlign<enum_TabContainer_TabAlign>` **ALIGN_RIGHT** = ``2``
  167. Align the tabs to the right.
  168. .. rst-class:: classref-section-separator
  169. ----
  170. .. rst-class:: classref-descriptions-group
  171. Property Descriptions
  172. ---------------------
  173. .. _class_TabContainer_property_all_tabs_in_front:
  174. .. rst-class:: classref-property
  175. :ref:`bool<class_bool>` **all_tabs_in_front** = ``false``
  176. .. rst-class:: classref-property-setget
  177. - void **set_all_tabs_in_front** **(** :ref:`bool<class_bool>` value **)**
  178. - :ref:`bool<class_bool>` **is_all_tabs_in_front** **(** **)**
  179. If ``true``, all tabs are drawn in front of the panel. If ``false``, inactive tabs are drawn behind the panel.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_TabContainer_property_current_tab:
  183. .. rst-class:: classref-property
  184. :ref:`int<class_int>` **current_tab** = ``0``
  185. .. rst-class:: classref-property-setget
  186. - void **set_current_tab** **(** :ref:`int<class_int>` value **)**
  187. - :ref:`int<class_int>` **get_current_tab** **(** **)**
  188. The current tab index. When set, this index's :ref:`Control<class_Control>` node's ``visible`` property is set to ``true`` and all others are set to ``false``.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_TabContainer_property_drag_to_rearrange_enabled:
  192. .. rst-class:: classref-property
  193. :ref:`bool<class_bool>` **drag_to_rearrange_enabled** = ``false``
  194. .. rst-class:: classref-property-setget
  195. - void **set_drag_to_rearrange_enabled** **(** :ref:`bool<class_bool>` value **)**
  196. - :ref:`bool<class_bool>` **get_drag_to_rearrange_enabled** **(** **)**
  197. If ``true``, tabs can be rearranged with mouse drag.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_TabContainer_property_tab_align:
  201. .. rst-class:: classref-property
  202. :ref:`TabAlign<enum_TabContainer_TabAlign>` **tab_align** = ``1``
  203. .. rst-class:: classref-property-setget
  204. - void **set_tab_align** **(** :ref:`TabAlign<enum_TabContainer_TabAlign>` value **)**
  205. - :ref:`TabAlign<enum_TabContainer_TabAlign>` **get_tab_align** **(** **)**
  206. The alignment of all tabs in the tab container. See the :ref:`TabAlign<enum_TabContainer_TabAlign>` constants for details.
  207. .. rst-class:: classref-item-separator
  208. ----
  209. .. _class_TabContainer_property_tabs_visible:
  210. .. rst-class:: classref-property
  211. :ref:`bool<class_bool>` **tabs_visible** = ``true``
  212. .. rst-class:: classref-property-setget
  213. - void **set_tabs_visible** **(** :ref:`bool<class_bool>` value **)**
  214. - :ref:`bool<class_bool>` **are_tabs_visible** **(** **)**
  215. If ``true``, tabs are visible. If ``false``, tabs' content and titles are hidden.
  216. .. rst-class:: classref-item-separator
  217. ----
  218. .. _class_TabContainer_property_use_hidden_tabs_for_min_size:
  219. .. rst-class:: classref-property
  220. :ref:`bool<class_bool>` **use_hidden_tabs_for_min_size** = ``false``
  221. .. rst-class:: classref-property-setget
  222. - void **set_use_hidden_tabs_for_min_size** **(** :ref:`bool<class_bool>` value **)**
  223. - :ref:`bool<class_bool>` **get_use_hidden_tabs_for_min_size** **(** **)**
  224. If ``true``, children :ref:`Control<class_Control>` nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.
  225. .. rst-class:: classref-section-separator
  226. ----
  227. .. rst-class:: classref-descriptions-group
  228. Method Descriptions
  229. -------------------
  230. .. _class_TabContainer_method_get_current_tab_control:
  231. .. rst-class:: classref-method
  232. :ref:`Control<class_Control>` **get_current_tab_control** **(** **)** |const|
  233. Returns the child :ref:`Control<class_Control>` node located at the active tab index.
  234. .. rst-class:: classref-item-separator
  235. ----
  236. .. _class_TabContainer_method_get_popup:
  237. .. rst-class:: classref-method
  238. :ref:`Popup<class_Popup>` **get_popup** **(** **)** |const|
  239. Returns the :ref:`Popup<class_Popup>` node instance if one has been set already with :ref:`set_popup<class_TabContainer_method_set_popup>`.
  240. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  241. .. rst-class:: classref-item-separator
  242. ----
  243. .. _class_TabContainer_method_get_previous_tab:
  244. .. rst-class:: classref-method
  245. :ref:`int<class_int>` **get_previous_tab** **(** **)** |const|
  246. Returns the previously active tab index.
  247. .. rst-class:: classref-item-separator
  248. ----
  249. .. _class_TabContainer_method_get_tab_control:
  250. .. rst-class:: classref-method
  251. :ref:`Control<class_Control>` **get_tab_control** **(** :ref:`int<class_int>` tab_idx **)** |const|
  252. Returns the :ref:`Control<class_Control>` node from the tab at index ``tab_idx``.
  253. .. rst-class:: classref-item-separator
  254. ----
  255. .. _class_TabContainer_method_get_tab_count:
  256. .. rst-class:: classref-method
  257. :ref:`int<class_int>` **get_tab_count** **(** **)** |const|
  258. Returns the number of tabs.
  259. .. rst-class:: classref-item-separator
  260. ----
  261. .. _class_TabContainer_method_get_tab_disabled:
  262. .. rst-class:: classref-method
  263. :ref:`bool<class_bool>` **get_tab_disabled** **(** :ref:`int<class_int>` tab_idx **)** |const|
  264. Returns ``true`` if the tab at index ``tab_idx`` is disabled.
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_TabContainer_method_get_tab_hidden:
  268. .. rst-class:: classref-method
  269. :ref:`bool<class_bool>` **get_tab_hidden** **(** :ref:`int<class_int>` tab_idx **)** |const|
  270. Returns ``true`` if the tab at index ``tab_idx`` is hidden.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_TabContainer_method_get_tab_icon:
  274. .. rst-class:: classref-method
  275. :ref:`Texture<class_Texture>` **get_tab_icon** **(** :ref:`int<class_int>` tab_idx **)** |const|
  276. Returns the :ref:`Texture<class_Texture>` for the tab at index ``tab_idx`` or ``null`` if the tab has no :ref:`Texture<class_Texture>`.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_TabContainer_method_get_tab_idx_at_point:
  280. .. rst-class:: classref-method
  281. :ref:`int<class_int>` **get_tab_idx_at_point** **(** :ref:`Vector2<class_Vector2>` point **)** |const|
  282. Returns the index of the tab at local coordinates ``point``. Returns ``-1`` if the point is outside the control boundaries or if there's no tab at the queried position.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_TabContainer_method_get_tab_metadata:
  286. .. rst-class:: classref-method
  287. :ref:`Variant<class_Variant>` **get_tab_metadata** **(** :ref:`int<class_int>` tab_idx **)** |const|
  288. Returns the metadata value set to the tab at index ``tab_idx``. If no metadata was previously set, returns ``null`` by default.
  289. .. rst-class:: classref-item-separator
  290. ----
  291. .. _class_TabContainer_method_get_tab_title:
  292. .. rst-class:: classref-method
  293. :ref:`String<class_String>` **get_tab_title** **(** :ref:`int<class_int>` tab_idx **)** |const|
  294. 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_TabContainer_method_set_tab_title>`.
  295. .. rst-class:: classref-item-separator
  296. ----
  297. .. _class_TabContainer_method_get_tabs_rearrange_group:
  298. .. rst-class:: classref-method
  299. :ref:`int<class_int>` **get_tabs_rearrange_group** **(** **)** |const|
  300. Returns the **TabContainer** rearrange group id.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_TabContainer_method_set_popup:
  304. .. rst-class:: classref-method
  305. void **set_popup** **(** :ref:`Node<class_Node>` popup **)**
  306. If set on a :ref:`Popup<class_Popup>` node instance, a popup menu icon appears in the top-right corner of the **TabContainer**. Clicking it will expand the :ref:`Popup<class_Popup>` node.
  307. .. rst-class:: classref-item-separator
  308. ----
  309. .. _class_TabContainer_method_set_tab_disabled:
  310. .. rst-class:: classref-method
  311. void **set_tab_disabled** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)**
  312. If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable.
  313. .. rst-class:: classref-item-separator
  314. ----
  315. .. _class_TabContainer_method_set_tab_hidden:
  316. .. rst-class:: classref-method
  317. void **set_tab_hidden** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` hidden **)**
  318. If ``hidden`` is ``true``, hides the tab at index ``tab_idx``, making it disappear from the tab area.
  319. .. rst-class:: classref-item-separator
  320. ----
  321. .. _class_TabContainer_method_set_tab_icon:
  322. .. rst-class:: classref-method
  323. void **set_tab_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)**
  324. Sets an icon for the tab at index ``tab_idx``.
  325. .. rst-class:: classref-item-separator
  326. ----
  327. .. _class_TabContainer_method_set_tab_metadata:
  328. .. rst-class:: classref-method
  329. void **set_tab_metadata** **(** :ref:`int<class_int>` tab_idx, :ref:`Variant<class_Variant>` metadata **)**
  330. Sets the metadata value for the tab at index ``tab_idx``.
  331. .. rst-class:: classref-item-separator
  332. ----
  333. .. _class_TabContainer_method_set_tab_title:
  334. .. rst-class:: classref-method
  335. void **set_tab_title** **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)**
  336. Sets a title for the tab at index ``tab_idx``. Tab titles default to the name of the indexed child node.
  337. .. rst-class:: classref-item-separator
  338. ----
  339. .. _class_TabContainer_method_set_tabs_rearrange_group:
  340. .. rst-class:: classref-method
  341. void **set_tabs_rearrange_group** **(** :ref:`int<class_int>` group_id **)**
  342. Defines rearrange group id, choose for each **TabContainer** the same value to enable tab drag between **TabContainer**. Enable drag with :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>`.
  343. .. rst-class:: classref-section-separator
  344. ----
  345. .. rst-class:: classref-descriptions-group
  346. Theme Property Descriptions
  347. ---------------------------
  348. .. _class_TabContainer_theme_color_font_color_bg:
  349. .. rst-class:: classref-themeproperty
  350. :ref:`Color<class_Color>` **font_color_bg** = ``Color( 0.69, 0.69, 0.69, 1 )``
  351. Font color of inactive tabs.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_TabContainer_theme_color_font_color_disabled:
  355. .. rst-class:: classref-themeproperty
  356. :ref:`Color<class_Color>` **font_color_disabled** = ``Color( 0.9, 0.9, 0.9, 0.2 )``
  357. Font color of disabled tabs.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_TabContainer_theme_color_font_color_fg:
  361. .. rst-class:: classref-themeproperty
  362. :ref:`Color<class_Color>` **font_color_fg** = ``Color( 0.94, 0.94, 0.94, 1 )``
  363. Font color of the currently selected tab.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_TabContainer_theme_constant_hseparation:
  367. .. rst-class:: classref-themeproperty
  368. :ref:`int<class_int>` **hseparation** = ``4``
  369. Horizontal separation between tabs.
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_TabContainer_theme_constant_label_valign_bg:
  373. .. rst-class:: classref-themeproperty
  374. :ref:`int<class_int>` **label_valign_bg** = ``2``
  375. .. container:: contribute
  376. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  377. .. rst-class:: classref-item-separator
  378. ----
  379. .. _class_TabContainer_theme_constant_label_valign_fg:
  380. .. rst-class:: classref-themeproperty
  381. :ref:`int<class_int>` **label_valign_fg** = ``0``
  382. .. container:: contribute
  383. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_TabContainer_theme_constant_side_margin:
  387. .. rst-class:: classref-themeproperty
  388. :ref:`int<class_int>` **side_margin** = ``8``
  389. The space at the left and right edges of the tab bar.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_TabContainer_theme_constant_top_margin:
  393. .. rst-class:: classref-themeproperty
  394. :ref:`int<class_int>` **top_margin** = ``24``
  395. .. container:: contribute
  396. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_TabContainer_theme_font_font:
  400. .. rst-class:: classref-themeproperty
  401. :ref:`Font<class_Font>` **font**
  402. The font used to draw tab names.
  403. .. rst-class:: classref-item-separator
  404. ----
  405. .. _class_TabContainer_theme_icon_decrement:
  406. .. rst-class:: classref-themeproperty
  407. :ref:`Texture<class_Texture>` **decrement**
  408. Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent.
  409. .. rst-class:: classref-item-separator
  410. ----
  411. .. _class_TabContainer_theme_icon_decrement_highlight:
  412. .. rst-class:: classref-themeproperty
  413. :ref:`Texture<class_Texture>` **decrement_highlight**
  414. Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_TabContainer_theme_icon_increment:
  418. .. rst-class:: classref-themeproperty
  419. :ref:`Texture<class_Texture>` **increment**
  420. Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_TabContainer_theme_icon_increment_highlight:
  424. .. rst-class:: classref-themeproperty
  425. :ref:`Texture<class_Texture>` **increment_highlight**
  426. Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _class_TabContainer_theme_icon_menu:
  430. .. rst-class:: classref-themeproperty
  431. :ref:`Texture<class_Texture>` **menu**
  432. The icon for the menu button (see :ref:`set_popup<class_TabContainer_method_set_popup>`).
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_TabContainer_theme_icon_menu_highlight:
  436. .. rst-class:: classref-themeproperty
  437. :ref:`Texture<class_Texture>` **menu_highlight**
  438. The icon for the menu button (see :ref:`set_popup<class_TabContainer_method_set_popup>`) when it's being hovered with the cursor.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _class_TabContainer_theme_style_panel:
  442. .. rst-class:: classref-themeproperty
  443. :ref:`StyleBox<class_StyleBox>` **panel**
  444. The style for the background fill.
  445. .. rst-class:: classref-item-separator
  446. ----
  447. .. _class_TabContainer_theme_style_tab_bg:
  448. .. rst-class:: classref-themeproperty
  449. :ref:`StyleBox<class_StyleBox>` **tab_bg**
  450. The style of inactive tabs.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_TabContainer_theme_style_tab_disabled:
  454. .. rst-class:: classref-themeproperty
  455. :ref:`StyleBox<class_StyleBox>` **tab_disabled**
  456. The style of disabled tabs.
  457. .. rst-class:: classref-item-separator
  458. ----
  459. .. _class_TabContainer_theme_style_tab_fg:
  460. .. rst-class:: classref-themeproperty
  461. :ref:`StyleBox<class_StyleBox>` **tab_fg**
  462. The style of the currently selected tab.
  463. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  464. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  465. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  466. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`