class_tabs.rst 34 KB

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