class_tabs.rst 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  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.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/Tabs.xml.
  6. .. _class_Tabs:
  7. Tabs
  8. ====
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Tabs control.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Simple tabs control, similar to :ref:`TabContainer<class_TabContainer>` but is only in charge of drawing tabs, not interacting with children.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+
  21. | :ref:`int<class_int>` | :ref:`current_tab<class_Tabs_property_current_tab>` | ``0`` |
  22. +---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`drag_to_rearrange_enabled<class_Tabs_property_drag_to_rearrange_enabled>` | ``false`` |
  24. +---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+
  25. | :ref:`bool<class_bool>` | :ref:`scrolling_enabled<class_Tabs_property_scrolling_enabled>` | ``true`` |
  26. +---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+
  27. | :ref:`TabAlign<enum_Tabs_TabAlign>` | :ref:`tab_align<class_Tabs_property_tab_align>` | ``1`` |
  28. +---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+
  29. | :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` | :ref:`tab_close_display_policy<class_Tabs_property_tab_close_display_policy>` | ``0`` |
  30. +---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+
  31. .. rst-class:: classref-reftable-group
  32. Methods
  33. -------
  34. .. table::
  35. :widths: auto
  36. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`add_tab<class_Tabs_method_add_tab>` **(** :ref:`String<class_String>` title="", :ref:`Texture<class_Texture>` icon=null **)** |
  38. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`ensure_tab_visible<class_Tabs_method_ensure_tab_visible>` **(** :ref:`int<class_int>` idx **)** |
  40. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`get_offset_buttons_visible<class_Tabs_method_get_offset_buttons_visible>` **(** **)** |const| |
  42. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`get_previous_tab<class_Tabs_method_get_previous_tab>` **(** **)** |const| |
  44. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`get_select_with_rmb<class_Tabs_method_get_select_with_rmb>` **(** **)** |const| |
  46. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Texture<class_Texture>` | :ref:`get_tab_button_icon<class_Tabs_method_get_tab_button_icon>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  48. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_tab_count<class_Tabs_method_get_tab_count>` **(** **)** |const| |
  50. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`get_tab_disabled<class_Tabs_method_get_tab_disabled>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  52. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`Texture<class_Texture>` | :ref:`get_tab_icon<class_Tabs_method_get_tab_icon>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  54. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`int<class_int>` | :ref:`get_tab_offset<class_Tabs_method_get_tab_offset>` **(** **)** |const| |
  56. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`Rect2<class_Rect2>` | :ref:`get_tab_rect<class_Tabs_method_get_tab_rect>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  58. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`String<class_String>` | :ref:`get_tab_title<class_Tabs_method_get_tab_title>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  60. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_tabs_rearrange_group<class_Tabs_method_get_tabs_rearrange_group>` **(** **)** |const| |
  62. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`move_tab<class_Tabs_method_move_tab>` **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)** |
  64. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`remove_tab<class_Tabs_method_remove_tab>` **(** :ref:`int<class_int>` tab_idx **)** |
  66. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`set_select_with_rmb<class_Tabs_method_set_select_with_rmb>` **(** :ref:`bool<class_bool>` enabled **)** |
  68. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`set_tab_button_icon<class_Tabs_method_set_tab_button_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)** |
  70. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`set_tab_disabled<class_Tabs_method_set_tab_disabled>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)** |
  72. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`set_tab_icon<class_Tabs_method_set_tab_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)** |
  74. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_tab_title<class_Tabs_method_set_tab_title>` **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)** |
  76. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_tabs_rearrange_group<class_Tabs_method_set_tabs_rearrange_group>` **(** :ref:`int<class_int>` group_id **)** |
  78. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  79. .. rst-class:: classref-reftable-group
  80. Theme Properties
  81. ----------------
  82. .. table::
  83. :widths: auto
  84. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  85. | :ref:`Color<class_Color>` | :ref:`font_color_bg<class_Tabs_theme_color_font_color_bg>` | ``Color( 0.69, 0.69, 0.69, 1 )`` |
  86. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  87. | :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_Tabs_theme_color_font_color_disabled>` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` |
  88. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`font_color_fg<class_Tabs_theme_color_font_color_fg>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  90. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  91. | :ref:`int<class_int>` | :ref:`hseparation<class_Tabs_theme_constant_hseparation>` | ``4`` |
  92. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  93. | :ref:`int<class_int>` | :ref:`label_valign_bg<class_Tabs_theme_constant_label_valign_bg>` | ``2`` |
  94. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  95. | :ref:`int<class_int>` | :ref:`label_valign_fg<class_Tabs_theme_constant_label_valign_fg>` | ``0`` |
  96. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  97. | :ref:`int<class_int>` | :ref:`top_margin<class_Tabs_theme_constant_top_margin>` | ``24`` |
  98. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  99. | :ref:`Font<class_Font>` | :ref:`font<class_Tabs_theme_font_font>` | |
  100. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  101. | :ref:`Texture<class_Texture>` | :ref:`close<class_Tabs_theme_icon_close>` | |
  102. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  103. | :ref:`Texture<class_Texture>` | :ref:`decrement<class_Tabs_theme_icon_decrement>` | |
  104. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  105. | :ref:`Texture<class_Texture>` | :ref:`decrement_highlight<class_Tabs_theme_icon_decrement_highlight>` | |
  106. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  107. | :ref:`Texture<class_Texture>` | :ref:`increment<class_Tabs_theme_icon_increment>` | |
  108. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  109. | :ref:`Texture<class_Texture>` | :ref:`increment_highlight<class_Tabs_theme_icon_increment_highlight>` | |
  110. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  111. | :ref:`StyleBox<class_StyleBox>` | :ref:`button<class_Tabs_theme_style_button>` | |
  112. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  113. | :ref:`StyleBox<class_StyleBox>` | :ref:`button_pressed<class_Tabs_theme_style_button_pressed>` | |
  114. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  115. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_bg<class_Tabs_theme_style_tab_bg>` | |
  116. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  117. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_disabled<class_Tabs_theme_style_tab_disabled>` | |
  118. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  119. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_fg<class_Tabs_theme_style_tab_fg>` | |
  120. +---------------------------------+------------------------------------------------------------------------+----------------------------------+
  121. .. rst-class:: classref-section-separator
  122. ----
  123. .. rst-class:: classref-descriptions-group
  124. Signals
  125. -------
  126. .. _class_Tabs_signal_reposition_active_tab_request:
  127. .. rst-class:: classref-signal
  128. **reposition_active_tab_request** **(** :ref:`int<class_int>` idx_to **)**
  129. Emitted when the active tab is rearranged via mouse drag. See :ref:`drag_to_rearrange_enabled<class_Tabs_property_drag_to_rearrange_enabled>`.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_Tabs_signal_right_button_pressed:
  133. .. rst-class:: classref-signal
  134. **right_button_pressed** **(** :ref:`int<class_int>` tab **)**
  135. Emitted when a tab's right button is pressed. See :ref:`set_tab_button_icon<class_Tabs_method_set_tab_button_icon>`.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_Tabs_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_Tabs_signal_tab_clicked:
  145. .. rst-class:: classref-signal
  146. **tab_clicked** **(** :ref:`int<class_int>` tab **)**
  147. Emitted when a tab is clicked, even if it is the current tab.
  148. .. rst-class:: classref-item-separator
  149. ----
  150. .. _class_Tabs_signal_tab_close:
  151. .. rst-class:: classref-signal
  152. **tab_close** **(** :ref:`int<class_int>` tab **)**
  153. Emitted when a tab is closed.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_Tabs_signal_tab_hover:
  157. .. rst-class:: classref-signal
  158. **tab_hover** **(** :ref:`int<class_int>` tab **)**
  159. Emitted when a tab is hovered by the mouse.
  160. .. rst-class:: classref-section-separator
  161. ----
  162. .. rst-class:: classref-descriptions-group
  163. Enumerations
  164. ------------
  165. .. _enum_Tabs_TabAlign:
  166. .. rst-class:: classref-enumeration
  167. enum **TabAlign**:
  168. .. _class_Tabs_constant_ALIGN_LEFT:
  169. .. rst-class:: classref-enumeration-constant
  170. :ref:`TabAlign<enum_Tabs_TabAlign>` **ALIGN_LEFT** = ``0``
  171. Align the tabs to the left.
  172. .. _class_Tabs_constant_ALIGN_CENTER:
  173. .. rst-class:: classref-enumeration-constant
  174. :ref:`TabAlign<enum_Tabs_TabAlign>` **ALIGN_CENTER** = ``1``
  175. Align the tabs to the center.
  176. .. _class_Tabs_constant_ALIGN_RIGHT:
  177. .. rst-class:: classref-enumeration-constant
  178. :ref:`TabAlign<enum_Tabs_TabAlign>` **ALIGN_RIGHT** = ``2``
  179. Align the tabs to the right.
  180. .. _class_Tabs_constant_ALIGN_MAX:
  181. .. rst-class:: classref-enumeration-constant
  182. :ref:`TabAlign<enum_Tabs_TabAlign>` **ALIGN_MAX** = ``3``
  183. Represents the size of the :ref:`TabAlign<enum_Tabs_TabAlign>` enum.
  184. .. rst-class:: classref-item-separator
  185. ----
  186. .. _enum_Tabs_CloseButtonDisplayPolicy:
  187. .. rst-class:: classref-enumeration
  188. enum **CloseButtonDisplayPolicy**:
  189. .. _class_Tabs_constant_CLOSE_BUTTON_SHOW_NEVER:
  190. .. rst-class:: classref-enumeration-constant
  191. :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_SHOW_NEVER** = ``0``
  192. Never show the close buttons.
  193. .. _class_Tabs_constant_CLOSE_BUTTON_SHOW_ACTIVE_ONLY:
  194. .. rst-class:: classref-enumeration-constant
  195. :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_SHOW_ACTIVE_ONLY** = ``1``
  196. Only show the close button on the currently active tab.
  197. .. _class_Tabs_constant_CLOSE_BUTTON_SHOW_ALWAYS:
  198. .. rst-class:: classref-enumeration-constant
  199. :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_SHOW_ALWAYS** = ``2``
  200. Show the close button on all tabs.
  201. .. _class_Tabs_constant_CLOSE_BUTTON_MAX:
  202. .. rst-class:: classref-enumeration-constant
  203. :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_MAX** = ``3``
  204. Represents the size of the :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` enum.
  205. .. rst-class:: classref-section-separator
  206. ----
  207. .. rst-class:: classref-descriptions-group
  208. Property Descriptions
  209. ---------------------
  210. .. _class_Tabs_property_current_tab:
  211. .. rst-class:: classref-property
  212. :ref:`int<class_int>` **current_tab** = ``0``
  213. .. rst-class:: classref-property-setget
  214. - void **set_current_tab** **(** :ref:`int<class_int>` value **)**
  215. - :ref:`int<class_int>` **get_current_tab** **(** **)**
  216. Select tab at index ``tab_idx``.
  217. .. rst-class:: classref-item-separator
  218. ----
  219. .. _class_Tabs_property_drag_to_rearrange_enabled:
  220. .. rst-class:: classref-property
  221. :ref:`bool<class_bool>` **drag_to_rearrange_enabled** = ``false``
  222. .. rst-class:: classref-property-setget
  223. - void **set_drag_to_rearrange_enabled** **(** :ref:`bool<class_bool>` value **)**
  224. - :ref:`bool<class_bool>` **get_drag_to_rearrange_enabled** **(** **)**
  225. If ``true``, tabs can be rearranged with mouse drag.
  226. .. rst-class:: classref-item-separator
  227. ----
  228. .. _class_Tabs_property_scrolling_enabled:
  229. .. rst-class:: classref-property
  230. :ref:`bool<class_bool>` **scrolling_enabled** = ``true``
  231. .. rst-class:: classref-property-setget
  232. - void **set_scrolling_enabled** **(** :ref:`bool<class_bool>` value **)**
  233. - :ref:`bool<class_bool>` **get_scrolling_enabled** **(** **)**
  234. if ``true``, the mouse's scroll wheel can be used to navigate the scroll view.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_Tabs_property_tab_align:
  238. .. rst-class:: classref-property
  239. :ref:`TabAlign<enum_Tabs_TabAlign>` **tab_align** = ``1``
  240. .. rst-class:: classref-property-setget
  241. - void **set_tab_align** **(** :ref:`TabAlign<enum_Tabs_TabAlign>` value **)**
  242. - :ref:`TabAlign<enum_Tabs_TabAlign>` **get_tab_align** **(** **)**
  243. The alignment of all tabs. See :ref:`TabAlign<enum_Tabs_TabAlign>` for details.
  244. .. rst-class:: classref-item-separator
  245. ----
  246. .. _class_Tabs_property_tab_close_display_policy:
  247. .. rst-class:: classref-property
  248. :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` **tab_close_display_policy** = ``0``
  249. .. rst-class:: classref-property-setget
  250. - void **set_tab_close_display_policy** **(** :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` value **)**
  251. - :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` **get_tab_close_display_policy** **(** **)**
  252. Sets when the close button will appear on the tabs. See :ref:`CloseButtonDisplayPolicy<enum_Tabs_CloseButtonDisplayPolicy>` for details.
  253. .. rst-class:: classref-section-separator
  254. ----
  255. .. rst-class:: classref-descriptions-group
  256. Method Descriptions
  257. -------------------
  258. .. _class_Tabs_method_add_tab:
  259. .. rst-class:: classref-method
  260. void **add_tab** **(** :ref:`String<class_String>` title="", :ref:`Texture<class_Texture>` icon=null **)**
  261. Adds a new tab.
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_Tabs_method_ensure_tab_visible:
  265. .. rst-class:: classref-method
  266. void **ensure_tab_visible** **(** :ref:`int<class_int>` idx **)**
  267. Moves the scroll view to make the tab visible.
  268. .. rst-class:: classref-item-separator
  269. ----
  270. .. _class_Tabs_method_get_offset_buttons_visible:
  271. .. rst-class:: classref-method
  272. :ref:`bool<class_bool>` **get_offset_buttons_visible** **(** **)** |const|
  273. Returns ``true`` if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_Tabs_method_get_previous_tab:
  277. .. rst-class:: classref-method
  278. :ref:`int<class_int>` **get_previous_tab** **(** **)** |const|
  279. Returns the previously active tab index.
  280. .. rst-class:: classref-item-separator
  281. ----
  282. .. _class_Tabs_method_get_select_with_rmb:
  283. .. rst-class:: classref-method
  284. :ref:`bool<class_bool>` **get_select_with_rmb** **(** **)** |const|
  285. Returns ``true`` if select with right mouse button is enabled.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_Tabs_method_get_tab_button_icon:
  289. .. rst-class:: classref-method
  290. :ref:`Texture<class_Texture>` **get_tab_button_icon** **(** :ref:`int<class_int>` tab_idx **)** |const|
  291. Returns the button icon from the tab at index ``tab_idx``.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_Tabs_method_get_tab_count:
  295. .. rst-class:: classref-method
  296. :ref:`int<class_int>` **get_tab_count** **(** **)** |const|
  297. Returns the number of tabs.
  298. .. rst-class:: classref-item-separator
  299. ----
  300. .. _class_Tabs_method_get_tab_disabled:
  301. .. rst-class:: classref-method
  302. :ref:`bool<class_bool>` **get_tab_disabled** **(** :ref:`int<class_int>` tab_idx **)** |const|
  303. Returns ``true`` if the tab at index ``tab_idx`` is disabled.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_Tabs_method_get_tab_icon:
  307. .. rst-class:: classref-method
  308. :ref:`Texture<class_Texture>` **get_tab_icon** **(** :ref:`int<class_int>` tab_idx **)** |const|
  309. Returns the :ref:`Texture<class_Texture>` for the tab at index ``tab_idx`` or ``null`` if the tab has no :ref:`Texture<class_Texture>`.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_Tabs_method_get_tab_offset:
  313. .. rst-class:: classref-method
  314. :ref:`int<class_int>` **get_tab_offset** **(** **)** |const|
  315. Returns the number of hidden tabs offsetted to the left.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_Tabs_method_get_tab_rect:
  319. .. rst-class:: classref-method
  320. :ref:`Rect2<class_Rect2>` **get_tab_rect** **(** :ref:`int<class_int>` tab_idx **)** |const|
  321. Returns tab :ref:`Rect2<class_Rect2>` with local position and size.
  322. .. rst-class:: classref-item-separator
  323. ----
  324. .. _class_Tabs_method_get_tab_title:
  325. .. rst-class:: classref-method
  326. :ref:`String<class_String>` **get_tab_title** **(** :ref:`int<class_int>` tab_idx **)** |const|
  327. Returns the title of the tab at index ``tab_idx``.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_Tabs_method_get_tabs_rearrange_group:
  331. .. rst-class:: classref-method
  332. :ref:`int<class_int>` **get_tabs_rearrange_group** **(** **)** |const|
  333. Returns the **Tabs**' rearrange group ID.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_Tabs_method_move_tab:
  337. .. rst-class:: classref-method
  338. void **move_tab** **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)**
  339. Moves a tab from ``from`` to ``to``.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_Tabs_method_remove_tab:
  343. .. rst-class:: classref-method
  344. void **remove_tab** **(** :ref:`int<class_int>` tab_idx **)**
  345. Removes the tab at index ``tab_idx``.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_Tabs_method_set_select_with_rmb:
  349. .. rst-class:: classref-method
  350. void **set_select_with_rmb** **(** :ref:`bool<class_bool>` enabled **)**
  351. If ``true``, enables selecting a tab with the right mouse button.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_Tabs_method_set_tab_button_icon:
  355. .. rst-class:: classref-method
  356. void **set_tab_button_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)**
  357. Sets the button icon from the tab at index ``tab_idx``.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_Tabs_method_set_tab_disabled:
  361. .. rst-class:: classref-method
  362. void **set_tab_disabled** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)**
  363. If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_Tabs_method_set_tab_icon:
  367. .. rst-class:: classref-method
  368. void **set_tab_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)**
  369. Sets an ``icon`` for the tab at index ``tab_idx``.
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_Tabs_method_set_tab_title:
  373. .. rst-class:: classref-method
  374. void **set_tab_title** **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)**
  375. Sets a ``title`` for the tab at index ``tab_idx``.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_Tabs_method_set_tabs_rearrange_group:
  379. .. rst-class:: classref-method
  380. void **set_tabs_rearrange_group** **(** :ref:`int<class_int>` group_id **)**
  381. Defines the rearrange group ID. Choose for each **Tabs** the same value to dragging tabs between **Tabs**. Enable drag with :ref:`drag_to_rearrange_enabled<class_Tabs_property_drag_to_rearrange_enabled>`.
  382. .. rst-class:: classref-section-separator
  383. ----
  384. .. rst-class:: classref-descriptions-group
  385. Theme Property Descriptions
  386. ---------------------------
  387. .. _class_Tabs_theme_color_font_color_bg:
  388. .. rst-class:: classref-themeproperty
  389. :ref:`Color<class_Color>` **font_color_bg** = ``Color( 0.69, 0.69, 0.69, 1 )``
  390. Font color of inactive tabs.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_Tabs_theme_color_font_color_disabled:
  394. .. rst-class:: classref-themeproperty
  395. :ref:`Color<class_Color>` **font_color_disabled** = ``Color( 0.9, 0.9, 0.9, 0.2 )``
  396. Font color of disabled tabs.
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_Tabs_theme_color_font_color_fg:
  400. .. rst-class:: classref-themeproperty
  401. :ref:`Color<class_Color>` **font_color_fg** = ``Color( 0.94, 0.94, 0.94, 1 )``
  402. Font color of the currently selected tab.
  403. .. rst-class:: classref-item-separator
  404. ----
  405. .. _class_Tabs_theme_constant_hseparation:
  406. .. rst-class:: classref-themeproperty
  407. :ref:`int<class_int>` **hseparation** = ``4``
  408. The horizontal separation between the tabs.
  409. .. rst-class:: classref-item-separator
  410. ----
  411. .. _class_Tabs_theme_constant_label_valign_bg:
  412. .. rst-class:: classref-themeproperty
  413. :ref:`int<class_int>` **label_valign_bg** = ``2``
  414. .. container:: contribute
  415. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  416. .. rst-class:: classref-item-separator
  417. ----
  418. .. _class_Tabs_theme_constant_label_valign_fg:
  419. .. rst-class:: classref-themeproperty
  420. :ref:`int<class_int>` **label_valign_fg** = ``0``
  421. .. container:: contribute
  422. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  423. .. rst-class:: classref-item-separator
  424. ----
  425. .. _class_Tabs_theme_constant_top_margin:
  426. .. rst-class:: classref-themeproperty
  427. :ref:`int<class_int>` **top_margin** = ``24``
  428. .. container:: contribute
  429. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  430. .. rst-class:: classref-item-separator
  431. ----
  432. .. _class_Tabs_theme_font_font:
  433. .. rst-class:: classref-themeproperty
  434. :ref:`Font<class_Font>` **font**
  435. The font used to draw tab names.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_Tabs_theme_icon_close:
  439. .. rst-class:: classref-themeproperty
  440. :ref:`Texture<class_Texture>` **close**
  441. The icon for the close button (see :ref:`tab_close_display_policy<class_Tabs_property_tab_close_display_policy>`).
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_Tabs_theme_icon_decrement:
  445. .. rst-class:: classref-themeproperty
  446. :ref:`Texture<class_Texture>` **decrement**
  447. 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.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_Tabs_theme_icon_decrement_highlight:
  451. .. rst-class:: classref-themeproperty
  452. :ref:`Texture<class_Texture>` **decrement_highlight**
  453. 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.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_Tabs_theme_icon_increment:
  457. .. rst-class:: classref-themeproperty
  458. :ref:`Texture<class_Texture>` **increment**
  459. 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.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_Tabs_theme_icon_increment_highlight:
  463. .. rst-class:: classref-themeproperty
  464. :ref:`Texture<class_Texture>` **increment_highlight**
  465. 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.
  466. .. rst-class:: classref-item-separator
  467. ----
  468. .. _class_Tabs_theme_style_button:
  469. .. rst-class:: classref-themeproperty
  470. :ref:`StyleBox<class_StyleBox>` **button**
  471. Background of the close button when it's being hovered with the cursor.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_Tabs_theme_style_button_pressed:
  475. .. rst-class:: classref-themeproperty
  476. :ref:`StyleBox<class_StyleBox>` **button_pressed**
  477. Background of the close button when it's being pressed.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_Tabs_theme_style_tab_bg:
  481. .. rst-class:: classref-themeproperty
  482. :ref:`StyleBox<class_StyleBox>` **tab_bg**
  483. The style of an inactive tab.
  484. .. rst-class:: classref-item-separator
  485. ----
  486. .. _class_Tabs_theme_style_tab_disabled:
  487. .. rst-class:: classref-themeproperty
  488. :ref:`StyleBox<class_StyleBox>` **tab_disabled**
  489. The style of a disabled tab
  490. .. rst-class:: classref-item-separator
  491. ----
  492. .. _class_Tabs_theme_style_tab_fg:
  493. .. rst-class:: classref-themeproperty
  494. :ref:`StyleBox<class_StyleBox>` **tab_fg**
  495. The style of the currently selected tab.
  496. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  497. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  498. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  499. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`