Tabs.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Tabs" inherits="Control" category="Core" version="3.1.2">
  3. <brief_description>
  4. Tabs Control.
  5. </brief_description>
  6. <description>
  7. Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interact with children.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_tab">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="title" type="String" default="&quot;&quot;">
  16. </argument>
  17. <argument index="1" name="icon" type="Texture" default="null">
  18. </argument>
  19. <description>
  20. Adds a new tab.
  21. </description>
  22. </method>
  23. <method name="ensure_tab_visible">
  24. <return type="void">
  25. </return>
  26. <argument index="0" name="idx" type="int">
  27. </argument>
  28. <description>
  29. Moves the Scroll view to make the tab visible.
  30. </description>
  31. </method>
  32. <method name="get_offset_buttons_visible" qualifiers="const">
  33. <return type="bool">
  34. </return>
  35. <description>
  36. </description>
  37. </method>
  38. <method name="get_select_with_rmb" qualifiers="const">
  39. <return type="bool">
  40. </return>
  41. <description>
  42. Returns [code]true[/code] if select with right mouse button is enabled.
  43. </description>
  44. </method>
  45. <method name="get_tab_count" qualifiers="const">
  46. <return type="int">
  47. </return>
  48. <description>
  49. Returns the number of tabs.
  50. </description>
  51. </method>
  52. <method name="get_tab_disabled" qualifiers="const">
  53. <return type="bool">
  54. </return>
  55. <argument index="0" name="tab_idx" type="int">
  56. </argument>
  57. <description>
  58. Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is disabled.
  59. </description>
  60. </method>
  61. <method name="get_tab_icon" qualifiers="const">
  62. <return type="Texture">
  63. </return>
  64. <argument index="0" name="tab_idx" type="int">
  65. </argument>
  66. <description>
  67. Returns the [Texture] for the tab at index [code]tab_idx[/code] or null if the tab has no [Texture].
  68. </description>
  69. </method>
  70. <method name="get_tab_offset" qualifiers="const">
  71. <return type="int">
  72. </return>
  73. <description>
  74. </description>
  75. </method>
  76. <method name="get_tab_rect" qualifiers="const">
  77. <return type="Rect2">
  78. </return>
  79. <argument index="0" name="tab_idx" type="int">
  80. </argument>
  81. <description>
  82. Returns tab [Rect2] with local position and size.
  83. </description>
  84. </method>
  85. <method name="get_tab_title" qualifiers="const">
  86. <return type="String">
  87. </return>
  88. <argument index="0" name="tab_idx" type="int">
  89. </argument>
  90. <description>
  91. Returns the title of the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title].
  92. </description>
  93. </method>
  94. <method name="get_tabs_rearrange_group" qualifiers="const">
  95. <return type="int">
  96. </return>
  97. <description>
  98. Returns the [code]Tabs[/code] rearrange group id.
  99. </description>
  100. </method>
  101. <method name="move_tab">
  102. <return type="void">
  103. </return>
  104. <argument index="0" name="from" type="int">
  105. </argument>
  106. <argument index="1" name="to" type="int">
  107. </argument>
  108. <description>
  109. Rearrange tab.
  110. </description>
  111. </method>
  112. <method name="remove_tab">
  113. <return type="void">
  114. </return>
  115. <argument index="0" name="tab_idx" type="int">
  116. </argument>
  117. <description>
  118. Removes tab at index [code]tab_idx[/code]
  119. </description>
  120. </method>
  121. <method name="set_select_with_rmb">
  122. <return type="void">
  123. </return>
  124. <argument index="0" name="enabled" type="bool">
  125. </argument>
  126. <description>
  127. If [code]true[/code], enables selecting a tab with right mouse button.
  128. </description>
  129. </method>
  130. <method name="set_tab_disabled">
  131. <return type="void">
  132. </return>
  133. <argument index="0" name="tab_idx" type="int">
  134. </argument>
  135. <argument index="1" name="disabled" type="bool">
  136. </argument>
  137. <description>
  138. If [code]disabled[/code] is [code]false[/code], hides the tab at index [code]tab_idx[/code]. Note that its title text will remain, unless also removed with [method set_tab_title].
  139. </description>
  140. </method>
  141. <method name="set_tab_icon">
  142. <return type="void">
  143. </return>
  144. <argument index="0" name="tab_idx" type="int">
  145. </argument>
  146. <argument index="1" name="icon" type="Texture">
  147. </argument>
  148. <description>
  149. Sets an icon for the tab at index [code]tab_idx[/code].
  150. </description>
  151. </method>
  152. <method name="set_tab_title">
  153. <return type="void">
  154. </return>
  155. <argument index="0" name="tab_idx" type="int">
  156. </argument>
  157. <argument index="1" name="title" type="String">
  158. </argument>
  159. <description>
  160. Sets a title for the tab at index [code]tab_idx[/code].
  161. </description>
  162. </method>
  163. <method name="set_tabs_rearrange_group">
  164. <return type="void">
  165. </return>
  166. <argument index="0" name="group_id" type="int">
  167. </argument>
  168. <description>
  169. Defines rearrange group id, choose for each [code]Tabs[/code] the same value to enable tab drag between [code]Tabs[/code]. Enable drag with [code]set_drag_to_rearrange_enabled(true)[/code].
  170. </description>
  171. </method>
  172. </methods>
  173. <members>
  174. <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab">
  175. Select tab at index [code]tab_idx[/code].
  176. </member>
  177. <member name="drag_to_rearrange_enabled" type="bool" setter="set_drag_to_rearrange_enabled" getter="get_drag_to_rearrange_enabled">
  178. If [code]true[/code], tabs can be rearranged with mouse drag.
  179. </member>
  180. <member name="scrolling_enabled" type="bool" setter="set_scrolling_enabled" getter="get_scrolling_enabled">
  181. </member>
  182. <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="Tabs.TabAlign">
  183. The alignment of all tabs. See enum [code]TabAlign[/code] constants for details.
  184. </member>
  185. <member name="tab_close_display_policy" type="int" setter="set_tab_close_display_policy" getter="get_tab_close_display_policy" enum="Tabs.CloseButtonDisplayPolicy">
  186. </member>
  187. </members>
  188. <signals>
  189. <signal name="reposition_active_tab_request">
  190. <argument index="0" name="idx_to" type="int">
  191. </argument>
  192. <description>
  193. </description>
  194. </signal>
  195. <signal name="right_button_pressed">
  196. <argument index="0" name="tab" type="int">
  197. </argument>
  198. <description>
  199. </description>
  200. </signal>
  201. <signal name="tab_changed">
  202. <argument index="0" name="tab" type="int">
  203. </argument>
  204. <description>
  205. </description>
  206. </signal>
  207. <signal name="tab_clicked">
  208. <argument index="0" name="tab" type="int">
  209. </argument>
  210. <description>
  211. </description>
  212. </signal>
  213. <signal name="tab_close">
  214. <argument index="0" name="tab" type="int">
  215. </argument>
  216. <description>
  217. </description>
  218. </signal>
  219. <signal name="tab_hover">
  220. <argument index="0" name="tab" type="int">
  221. </argument>
  222. <description>
  223. </description>
  224. </signal>
  225. </signals>
  226. <constants>
  227. <constant name="ALIGN_LEFT" value="0" enum="TabAlign">
  228. Align the tabs to the left.
  229. </constant>
  230. <constant name="ALIGN_CENTER" value="1" enum="TabAlign">
  231. Align the tabs to the center.
  232. </constant>
  233. <constant name="ALIGN_RIGHT" value="2" enum="TabAlign">
  234. Align the tabs to the right.
  235. </constant>
  236. <constant name="ALIGN_MAX" value="3" enum="TabAlign">
  237. Represents the size of the [enum TabAlign] enum.
  238. </constant>
  239. <constant name="CLOSE_BUTTON_SHOW_NEVER" value="0" enum="CloseButtonDisplayPolicy">
  240. </constant>
  241. <constant name="CLOSE_BUTTON_SHOW_ACTIVE_ONLY" value="1" enum="CloseButtonDisplayPolicy">
  242. </constant>
  243. <constant name="CLOSE_BUTTON_SHOW_ALWAYS" value="2" enum="CloseButtonDisplayPolicy">
  244. </constant>
  245. <constant name="CLOSE_BUTTON_MAX" value="3" enum="CloseButtonDisplayPolicy">
  246. Represents the size of the [enum CloseButtonDisplayPolicy] enum.
  247. </constant>
  248. </constants>
  249. <theme_items>
  250. <theme_item name="button" type="StyleBox">
  251. </theme_item>
  252. <theme_item name="button_pressed" type="StyleBox">
  253. </theme_item>
  254. <theme_item name="close" type="Texture">
  255. </theme_item>
  256. <theme_item name="decrement" type="Texture">
  257. </theme_item>
  258. <theme_item name="decrement_highlight" type="Texture">
  259. </theme_item>
  260. <theme_item name="font" type="Font">
  261. </theme_item>
  262. <theme_item name="font_color_bg" type="Color">
  263. </theme_item>
  264. <theme_item name="font_color_disabled" type="Color">
  265. </theme_item>
  266. <theme_item name="font_color_fg" type="Color">
  267. </theme_item>
  268. <theme_item name="hseparation" type="int">
  269. </theme_item>
  270. <theme_item name="increment" type="Texture">
  271. </theme_item>
  272. <theme_item name="increment_highlight" type="Texture">
  273. </theme_item>
  274. <theme_item name="label_valign_bg" type="int">
  275. </theme_item>
  276. <theme_item name="label_valign_fg" type="int">
  277. </theme_item>
  278. <theme_item name="panel" type="StyleBox">
  279. </theme_item>
  280. <theme_item name="tab_bg" type="StyleBox">
  281. </theme_item>
  282. <theme_item name="tab_disabled" type="StyleBox">
  283. </theme_item>
  284. <theme_item name="tab_fg" type="StyleBox">
  285. </theme_item>
  286. <theme_item name="top_margin" type="int">
  287. </theme_item>
  288. </theme_items>
  289. </class>