Tabs.xml 8.7 KB

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