TabContainer.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TabContainer" inherits="Control" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Tabbed Container.
  5. </brief_description>
  6. <description>
  7. Sets the active tab's [code]visible[/code] property to the value [code]true[/code]. Sets all other children's to [code]false[/code].
  8. Ignores non-[Control] children.
  9. Individual tabs are always visible unless you use [method set_tab_disabled] and [method set_tab_title] to hide it.
  10. To hide only a tab's content, nest the content inside a child [Control], so it receives the [code]TabContainer[/code]'s visibility setting instead.
  11. </description>
  12. <tutorials>
  13. </tutorials>
  14. <demos>
  15. </demos>
  16. <methods>
  17. <method name="are_tabs_visible" qualifiers="const">
  18. <return type="bool">
  19. </return>
  20. <description>
  21. Returns [code]true[/code] if the tabs are visible.
  22. </description>
  23. </method>
  24. <method name="get_current_tab" qualifiers="const">
  25. <return type="int">
  26. </return>
  27. <description>
  28. Returns the currently visible tab's index.
  29. </description>
  30. </method>
  31. <method name="get_current_tab_control" qualifiers="const">
  32. <return type="Control">
  33. </return>
  34. <description>
  35. Returns the child [Control] node located at the active tab index.
  36. </description>
  37. </method>
  38. <method name="get_popup" qualifiers="const">
  39. <return type="Popup">
  40. </return>
  41. <description>
  42. Returns the [Popup] node instance if one has been set already with [method set_popup].
  43. </description>
  44. </method>
  45. <method name="get_previous_tab" qualifiers="const">
  46. <return type="int">
  47. </return>
  48. <description>
  49. Returns the previously active tab index.
  50. </description>
  51. </method>
  52. <method name="get_tab_align" qualifiers="const">
  53. <return type="int" enum="TabContainer.TabAlign">
  54. </return>
  55. <description>
  56. Returns the tab alignment. See the [code]ALIGN_*[/code] constants.
  57. </description>
  58. </method>
  59. <method name="get_tab_control" qualifiers="const">
  60. <return type="Control">
  61. </return>
  62. <argument index="0" name="idx" type="int">
  63. </argument>
  64. <description>
  65. Returns the currently visible tab's [Control] node.
  66. </description>
  67. </method>
  68. <method name="get_tab_count" qualifiers="const">
  69. <return type="int">
  70. </return>
  71. <description>
  72. Returns the number of tabs.
  73. </description>
  74. </method>
  75. <method name="get_tab_disabled" qualifiers="const">
  76. <return type="bool">
  77. </return>
  78. <argument index="0" name="tab_idx" type="int">
  79. </argument>
  80. <description>
  81. Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is disabled.
  82. </description>
  83. </method>
  84. <method name="get_tab_icon" qualifiers="const">
  85. <return type="Texture">
  86. </return>
  87. <argument index="0" name="tab_idx" type="int">
  88. </argument>
  89. <description>
  90. Returns the [Texture] for the tab at index [code]tab_idx[/code] or null if the tab has no [Texture].
  91. </description>
  92. </method>
  93. <method name="get_tab_title" qualifiers="const">
  94. <return type="String">
  95. </return>
  96. <argument index="0" name="tab_idx" type="int">
  97. </argument>
  98. <description>
  99. 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].
  100. </description>
  101. </method>
  102. <method name="set_current_tab">
  103. <return type="void">
  104. </return>
  105. <argument index="0" name="tab_idx" type="int">
  106. </argument>
  107. <description>
  108. Sets to [code]false[/code] the [code]visible[/code] property for all [Control] children except for the tab at [code]tab_idx[/code].
  109. </description>
  110. </method>
  111. <method name="set_popup">
  112. <return type="void">
  113. </return>
  114. <argument index="0" name="popup" type="Node">
  115. </argument>
  116. <description>
  117. If set on a [Popup] node instance, a popup menu icon appears in the top-right corner of the [code]TabContainer[/code]. Clicking it will expand the [Popup] node.
  118. </description>
  119. </method>
  120. <method name="set_tab_align">
  121. <return type="void">
  122. </return>
  123. <argument index="0" name="align" type="int" enum="TabContainer.TabAlign">
  124. </argument>
  125. <description>
  126. Sets tab alignment, from the [code]ALIGN_*[/code] constants. Moves tabs to the left, right, or center.
  127. </description>
  128. </method>
  129. <method name="set_tab_disabled">
  130. <return type="void">
  131. </return>
  132. <argument index="0" name="tab_idx" type="int">
  133. </argument>
  134. <argument index="1" name="disabled" type="bool">
  135. </argument>
  136. <description>
  137. 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].
  138. </description>
  139. </method>
  140. <method name="set_tab_icon">
  141. <return type="void">
  142. </return>
  143. <argument index="0" name="tab_idx" type="int">
  144. </argument>
  145. <argument index="1" name="icon" type="Texture">
  146. </argument>
  147. <description>
  148. Sets an icon for the tab at index [code]tab_idx[/code].
  149. </description>
  150. </method>
  151. <method name="set_tab_title">
  152. <return type="void">
  153. </return>
  154. <argument index="0" name="tab_idx" type="int">
  155. </argument>
  156. <argument index="1" name="title" type="String">
  157. </argument>
  158. <description>
  159. Sets a title for 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].
  160. </description>
  161. </method>
  162. <method name="set_tabs_visible">
  163. <return type="void">
  164. </return>
  165. <argument index="0" name="visible" type="bool">
  166. </argument>
  167. <description>
  168. If [code]true[/code] tabs are visible. If [code]false[/code] tabs' content and titles are hidden. Default value: [code]true[/code].
  169. </description>
  170. </method>
  171. </methods>
  172. <members>
  173. <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab">
  174. The current tab index. When set, this index's [Control] node's [code]visible[/code] property is set to [code]true[/code] and all others are set to [code]false[/code].
  175. </member>
  176. <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabContainer.TabAlign">
  177. The alignment of all tabs in the tab container. See the [code]ALIGN_*[/code] constants for details.
  178. </member>
  179. <member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible">
  180. If [code]true[/code] tabs are visible. If [code]false[/code] tabs' content and titles are hidden. Default value: [code]true[/code].
  181. </member>
  182. </members>
  183. <signals>
  184. <signal name="pre_popup_pressed">
  185. <description>
  186. Emitted when the [code]TabContainer[/code]'s [Popup] button is clicked. See [method set_popup] for details.
  187. </description>
  188. </signal>
  189. <signal name="tab_changed">
  190. <argument index="0" name="tab" type="int">
  191. </argument>
  192. <description>
  193. Emitted when switching to another tab.
  194. </description>
  195. </signal>
  196. <signal name="tab_selected">
  197. <argument index="0" name="tab" type="int">
  198. </argument>
  199. <description>
  200. Emitted when a tab is selected, even if it is the current tab.
  201. </description>
  202. </signal>
  203. </signals>
  204. <constants>
  205. <constant name="ALIGN_LEFT" value="0">
  206. </constant>
  207. <constant name="ALIGN_CENTER" value="1">
  208. </constant>
  209. <constant name="ALIGN_RIGHT" value="2">
  210. </constant>
  211. </constants>
  212. <theme_items>
  213. <theme_item name="decrement" type="Texture">
  214. </theme_item>
  215. <theme_item name="decrement_highlight" type="Texture">
  216. </theme_item>
  217. <theme_item name="font" type="Font">
  218. </theme_item>
  219. <theme_item name="font_color_bg" type="Color">
  220. </theme_item>
  221. <theme_item name="font_color_disabled" type="Color">
  222. </theme_item>
  223. <theme_item name="font_color_fg" type="Color">
  224. </theme_item>
  225. <theme_item name="hseparation" type="int">
  226. </theme_item>
  227. <theme_item name="increment" type="Texture">
  228. </theme_item>
  229. <theme_item name="increment_highlight" type="Texture">
  230. </theme_item>
  231. <theme_item name="label_valign_bg" type="int">
  232. </theme_item>
  233. <theme_item name="label_valign_fg" type="int">
  234. </theme_item>
  235. <theme_item name="menu" type="Texture">
  236. </theme_item>
  237. <theme_item name="menu_highlight" type="Texture">
  238. </theme_item>
  239. <theme_item name="panel" type="StyleBox">
  240. </theme_item>
  241. <theme_item name="side_margin" type="int">
  242. </theme_item>
  243. <theme_item name="tab_bg" type="StyleBox">
  244. </theme_item>
  245. <theme_item name="tab_fg" type="StyleBox">
  246. </theme_item>
  247. <theme_item name="top_margin" type="int">
  248. </theme_item>
  249. </theme_items>
  250. </class>