class_treeitem.rst 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the TreeItem.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_TreeItem:
  5. TreeItem
  6. ========
  7. **Inherits:** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Control for a single item inside a :ref:`Tree<class_tree>`.
  12. Member Functions
  13. ----------------
  14. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_button<class_TreeItem_add_button>` **(** :ref:`int<class_int>` column, :ref:`Texture<class_texture>` button, :ref:`int<class_int>` button_idx=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_string>` tooltip="" **)** |
  16. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`clear_custom_bg_color<class_TreeItem_clear_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |
  18. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`clear_custom_color<class_TreeItem_clear_custom_color>` **(** :ref:`int<class_int>` column **)** |
  20. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`deselect<class_TreeItem_deselect>` **(** :ref:`int<class_int>` column **)** |
  22. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`erase_button<class_TreeItem_erase_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |
  24. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Texture<class_texture>` | :ref:`get_button<class_TreeItem_get_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** const |
  26. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_button_count<class_TreeItem_get_button_count>` **(** :ref:`int<class_int>` column **)** const |
  28. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_cell_mode<class_TreeItem_get_cell_mode>` **(** :ref:`int<class_int>` column **)** const |
  30. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`TreeItem<class_treeitem>` | :ref:`get_children<class_TreeItem_get_children>` **(** **)** |
  32. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Color<class_color>` | :ref:`get_custom_bg_color<class_TreeItem_get_custom_bg_color>` **(** :ref:`int<class_int>` column **)** const |
  34. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`get_expand_right<class_TreeItem_get_expand_right>` **(** :ref:`int<class_int>` column **)** const |
  36. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Texture<class_texture>` | :ref:`get_icon<class_TreeItem_get_icon>` **(** :ref:`int<class_int>` column **)** const |
  38. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`int<class_int>` | :ref:`get_icon_max_width<class_TreeItem_get_icon_max_width>` **(** :ref:`int<class_int>` column **)** const |
  40. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Rect2<class_rect2>` | :ref:`get_icon_region<class_TreeItem_get_icon_region>` **(** :ref:`int<class_int>` column **)** const |
  42. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Variant<class_variant>` | :ref:`get_metadata<class_TreeItem_get_metadata>` **(** :ref:`int<class_int>` column **)** const |
  44. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`TreeItem<class_treeitem>` | :ref:`get_next<class_TreeItem_get_next>` **(** **)** |
  46. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`TreeItem<class_treeitem>` | :ref:`get_next_visible<class_TreeItem_get_next_visible>` **(** **)** |
  48. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`TreeItem<class_treeitem>` | :ref:`get_parent<class_TreeItem_get_parent>` **(** **)** |
  50. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`TreeItem<class_treeitem>` | :ref:`get_prev<class_TreeItem_get_prev>` **(** **)** |
  52. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`TreeItem<class_treeitem>` | :ref:`get_prev_visible<class_TreeItem_get_prev_visible>` **(** **)** |
  54. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`float<class_float>` | :ref:`get_range<class_TreeItem_get_range>` **(** :ref:`int<class_int>` column **)** const |
  56. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`Dictionary<class_dictionary>` | :ref:`get_range_config<class_TreeItem_get_range_config>` **(** :ref:`int<class_int>` column **)** |
  58. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`String<class_string>` | :ref:`get_text<class_TreeItem_get_text>` **(** :ref:`int<class_int>` column **)** const |
  60. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_text_align<class_TreeItem_get_text_align>` **(** :ref:`int<class_int>` column **)** const |
  62. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`String<class_string>` | :ref:`get_tooltip<class_TreeItem_get_tooltip>` **(** :ref:`int<class_int>` column **)** const |
  64. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`is_button_disabled<class_TreeItem_is_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** const |
  66. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`is_checked<class_TreeItem_is_checked>` **(** :ref:`int<class_int>` column **)** const |
  68. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`bool<class_bool>` | :ref:`is_custom_set_as_button<class_TreeItem_is_custom_set_as_button>` **(** :ref:`int<class_int>` column **)** const |
  70. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`is_editable<class_TreeItem_is_editable>` **(** :ref:`int<class_int>` column **)** |
  72. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`is_selectable<class_TreeItem_is_selectable>` **(** :ref:`int<class_int>` column **)** const |
  74. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`is_selected<class_TreeItem_is_selected>` **(** :ref:`int<class_int>` column **)** |
  76. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`move_to_bottom<class_TreeItem_move_to_bottom>` **(** **)** |
  78. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`move_to_top<class_TreeItem_move_to_top>` **(** **)** |
  80. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`remove_child<class_TreeItem_remove_child>` **(** :ref:`Object<class_object>` child **)** |
  82. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`select<class_TreeItem_select>` **(** :ref:`int<class_int>` column **)** |
  84. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`set_button<class_TreeItem_set_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture<class_texture>` button **)** |
  86. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`set_cell_mode<class_TreeItem_set_cell_mode>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` mode **)** |
  88. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`set_checked<class_TreeItem_set_checked>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)** |
  90. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`set_custom_as_button<class_TreeItem_set_custom_as_button>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  92. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`set_custom_bg_color<class_TreeItem_set_custom_bg_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_color>` color, :ref:`bool<class_bool>` just_outline=false **)** |
  94. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`set_custom_color<class_TreeItem_set_custom_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_color>` color **)** |
  96. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`set_custom_draw<class_TreeItem_set_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Object<class_object>` object, :ref:`String<class_string>` callback **)** |
  98. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`set_editable<class_TreeItem_set_editable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)** |
  100. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`set_expand_right<class_TreeItem_set_expand_right>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  102. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`set_icon<class_TreeItem_set_icon>` **(** :ref:`int<class_int>` column, :ref:`Texture<class_texture>` texture **)** |
  104. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`set_icon_max_width<class_TreeItem_set_icon_max_width>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)** |
  106. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`set_icon_region<class_TreeItem_set_icon_region>` **(** :ref:`int<class_int>` column, :ref:`Rect2<class_rect2>` region **)** |
  108. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`set_metadata<class_TreeItem_set_metadata>` **(** :ref:`int<class_int>` column, :ref:`Variant<class_variant>` meta **)** |
  110. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`set_range<class_TreeItem_set_range>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)** |
  112. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`set_range_config<class_TreeItem_set_range_config>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step, :ref:`bool<class_bool>` expr=false **)** |
  114. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`set_selectable<class_TreeItem_set_selectable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)** |
  116. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`set_text<class_TreeItem_set_text>` **(** :ref:`int<class_int>` column, :ref:`String<class_string>` text **)** |
  118. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`set_text_align<class_TreeItem_set_text_align>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` text_align **)** |
  120. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`set_tooltip<class_TreeItem_set_tooltip>` **(** :ref:`int<class_int>` column, :ref:`String<class_string>` tooltip **)** |
  122. +--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. Member Variables
  124. ----------------
  125. .. _class_TreeItem_collapsed:
  126. - :ref:`bool<class_bool>` **collapsed** - If ``true`` the TreeItem is collapsed.
  127. .. _class_TreeItem_custom_minimum_height:
  128. - :ref:`int<class_int>` **custom_minimum_height** - The custom minimum height.
  129. .. _class_TreeItem_disable_folding:
  130. - :ref:`bool<class_bool>` **disable_folding** - If ``true`` folding is disabled for this TreeItem.
  131. Enums
  132. -----
  133. .. _enum_TreeItem_TreeCellMode:
  134. enum **TreeCellMode**
  135. - **CELL_MODE_STRING** = **0** --- Cell contains a string.
  136. - **CELL_MODE_CHECK** = **1** --- Cell can be checked.
  137. - **CELL_MODE_RANGE** = **2** --- Cell contains a range.
  138. - **CELL_MODE_RANGE_EXPRESSION** = **3** --- Cell contains a range expression.
  139. - **CELL_MODE_ICON** = **4** --- Cell contains an icon.
  140. - **CELL_MODE_CUSTOM** = **5**
  141. .. _enum_TreeItem_TextAlign:
  142. enum **TextAlign**
  143. - **ALIGN_LEFT** = **0** --- Align text to the left. See ``set_text_align()``.
  144. - **ALIGN_CENTER** = **1** --- Center text. See ``set_text_align()``.
  145. - **ALIGN_RIGHT** = **2** --- Align text to the right. See ``set_text_align()``.
  146. Description
  147. -----------
  148. Control for a single item inside a :ref:`Tree<class_tree>`. May have child ``TreeItem``\ s and be styled as well as contain buttons.
  149. Member Function Description
  150. ---------------------------
  151. .. _class_TreeItem_add_button:
  152. - void **add_button** **(** :ref:`int<class_int>` column, :ref:`Texture<class_texture>` button, :ref:`int<class_int>` button_idx=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_string>` tooltip="" **)**
  153. Adds a button with :ref:`Texture<class_texture>` ``button`` at column ``column``. The ``button_idx`` index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling ``get_buton_count()`` immediately after this method. Optionally, the button can be ``disabled`` and have a ``tooltip``.
  154. .. _class_TreeItem_clear_custom_bg_color:
  155. - void **clear_custom_bg_color** **(** :ref:`int<class_int>` column **)**
  156. Resets the background color for the given column to default.
  157. .. _class_TreeItem_clear_custom_color:
  158. - void **clear_custom_color** **(** :ref:`int<class_int>` column **)**
  159. Resets the color for the given column to default.
  160. .. _class_TreeItem_deselect:
  161. - void **deselect** **(** :ref:`int<class_int>` column **)**
  162. Deselects the given column.
  163. .. _class_TreeItem_erase_button:
  164. - void **erase_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)**
  165. Removes the button at index ``button_idx`` in column ``column``.
  166. .. _class_TreeItem_get_button:
  167. - :ref:`Texture<class_texture>` **get_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** const
  168. Returns the :ref:`Texture<class_texture>` of the button at index ``button_idx`` in column ``column``.
  169. .. _class_TreeItem_get_button_count:
  170. - :ref:`int<class_int>` **get_button_count** **(** :ref:`int<class_int>` column **)** const
  171. Returns the number of buttons in column ``column``. May be used to get the most recently added button's index, if no index was specified.
  172. .. _class_TreeItem_get_cell_mode:
  173. - :ref:`int<class_int>` **get_cell_mode** **(** :ref:`int<class_int>` column **)** const
  174. Returns the column's cell mode. See ``CELL_MODE_*`` constants.
  175. .. _class_TreeItem_get_children:
  176. - :ref:`TreeItem<class_treeitem>` **get_children** **(** **)**
  177. Returns the TreeItem's child items.
  178. .. _class_TreeItem_get_custom_bg_color:
  179. - :ref:`Color<class_color>` **get_custom_bg_color** **(** :ref:`int<class_int>` column **)** const
  180. Returns the custom background color of column ``column``.
  181. .. _class_TreeItem_get_expand_right:
  182. - :ref:`bool<class_bool>` **get_expand_right** **(** :ref:`int<class_int>` column **)** const
  183. Returns ``true`` if ``expand_right`` is set.
  184. .. _class_TreeItem_get_icon:
  185. - :ref:`Texture<class_texture>` **get_icon** **(** :ref:`int<class_int>` column **)** const
  186. Returns the given column's icon :ref:`Texture<class_texture>`. Error if no icon is set.
  187. .. _class_TreeItem_get_icon_max_width:
  188. - :ref:`int<class_int>` **get_icon_max_width** **(** :ref:`int<class_int>` column **)** const
  189. Returns the column's icon's maximum width.
  190. .. _class_TreeItem_get_icon_region:
  191. - :ref:`Rect2<class_rect2>` **get_icon_region** **(** :ref:`int<class_int>` column **)** const
  192. Returns the icon :ref:`Texture<class_texture>` region as :ref:`Rect2<class_rect2>`.
  193. .. _class_TreeItem_get_metadata:
  194. - :ref:`Variant<class_variant>` **get_metadata** **(** :ref:`int<class_int>` column **)** const
  195. .. _class_TreeItem_get_next:
  196. - :ref:`TreeItem<class_treeitem>` **get_next** **(** **)**
  197. Returns the next TreeItem in the tree.
  198. .. _class_TreeItem_get_next_visible:
  199. - :ref:`TreeItem<class_treeitem>` **get_next_visible** **(** **)**
  200. Returns the next visible TreeItem in the tree.
  201. .. _class_TreeItem_get_parent:
  202. - :ref:`TreeItem<class_treeitem>` **get_parent** **(** **)**
  203. Returns the parent TreeItem.
  204. .. _class_TreeItem_get_prev:
  205. - :ref:`TreeItem<class_treeitem>` **get_prev** **(** **)**
  206. Returns the previous TreeItem in the tree.
  207. .. _class_TreeItem_get_prev_visible:
  208. - :ref:`TreeItem<class_treeitem>` **get_prev_visible** **(** **)**
  209. Returns the previous visible TreeItem in the tree.
  210. .. _class_TreeItem_get_range:
  211. - :ref:`float<class_float>` **get_range** **(** :ref:`int<class_int>` column **)** const
  212. .. _class_TreeItem_get_range_config:
  213. - :ref:`Dictionary<class_dictionary>` **get_range_config** **(** :ref:`int<class_int>` column **)**
  214. .. _class_TreeItem_get_text:
  215. - :ref:`String<class_string>` **get_text** **(** :ref:`int<class_int>` column **)** const
  216. Returns the given column's text.
  217. .. _class_TreeItem_get_text_align:
  218. - :ref:`int<class_int>` **get_text_align** **(** :ref:`int<class_int>` column **)** const
  219. Returns the given column's text alignment.
  220. .. _class_TreeItem_get_tooltip:
  221. - :ref:`String<class_string>` **get_tooltip** **(** :ref:`int<class_int>` column **)** const
  222. Returns the given column's tooltip.
  223. .. _class_TreeItem_is_button_disabled:
  224. - :ref:`bool<class_bool>` **is_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** const
  225. Returns ``true`` if the button at index ``button_idx`` for the given column is disabled.
  226. .. _class_TreeItem_is_checked:
  227. - :ref:`bool<class_bool>` **is_checked** **(** :ref:`int<class_int>` column **)** const
  228. Returns ``true`` if the given column is checked.
  229. .. _class_TreeItem_is_custom_set_as_button:
  230. - :ref:`bool<class_bool>` **is_custom_set_as_button** **(** :ref:`int<class_int>` column **)** const
  231. .. _class_TreeItem_is_editable:
  232. - :ref:`bool<class_bool>` **is_editable** **(** :ref:`int<class_int>` column **)**
  233. Returns ``true`` if column ``column`` is editable.
  234. .. _class_TreeItem_is_selectable:
  235. - :ref:`bool<class_bool>` **is_selectable** **(** :ref:`int<class_int>` column **)** const
  236. Returns ``true`` if column ``column`` is selectable.
  237. .. _class_TreeItem_is_selected:
  238. - :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` column **)**
  239. Returns ``true`` if column ``column`` is selected.
  240. .. _class_TreeItem_move_to_bottom:
  241. - void **move_to_bottom** **(** **)**
  242. Moves this TreeItem to the bottom in the :ref:`Tree<class_tree>` hierarchy.
  243. .. _class_TreeItem_move_to_top:
  244. - void **move_to_top** **(** **)**
  245. Moves this TreeItem to the top in the :ref:`Tree<class_tree>` hierarchy.
  246. .. _class_TreeItem_remove_child:
  247. - void **remove_child** **(** :ref:`Object<class_object>` child **)**
  248. Removes the child TreeItem at index ``index``.
  249. .. _class_TreeItem_select:
  250. - void **select** **(** :ref:`int<class_int>` column **)**
  251. Selects the column ``column``.
  252. .. _class_TreeItem_set_button:
  253. - void **set_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture<class_texture>` button **)**
  254. Sets the given column's button :ref:`Texture<class_texture>` at index ``button_idx`` to ``button``.
  255. .. _class_TreeItem_set_cell_mode:
  256. - void **set_cell_mode** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` mode **)**
  257. Sets the given column's cell mode to ``mode``. See ``CELL_MODE_*`` constants.
  258. .. _class_TreeItem_set_checked:
  259. - void **set_checked** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)**
  260. If ``true`` the column ``column`` is checked.
  261. .. _class_TreeItem_set_custom_as_button:
  262. - void **set_custom_as_button** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  263. .. _class_TreeItem_set_custom_bg_color:
  264. - void **set_custom_bg_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_color>` color, :ref:`bool<class_bool>` just_outline=false **)**
  265. Sets the given column's custom background color and whether to just use it as an outline.
  266. .. _class_TreeItem_set_custom_color:
  267. - void **set_custom_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_color>` color **)**
  268. Sets the given column's custom color.
  269. .. _class_TreeItem_set_custom_draw:
  270. - void **set_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Object<class_object>` object, :ref:`String<class_string>` callback **)**
  271. Sets the given column's custom draw callback to ``callback`` method on ``object``.
  272. .. _class_TreeItem_set_editable:
  273. - void **set_editable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)**
  274. If ``true`` column ``column`` is editable.
  275. .. _class_TreeItem_set_expand_right:
  276. - void **set_expand_right** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  277. If ``true`` column ``column`` is expanded to the right.
  278. .. _class_TreeItem_set_icon:
  279. - void **set_icon** **(** :ref:`int<class_int>` column, :ref:`Texture<class_texture>` texture **)**
  280. Sets the given column's icon :ref:`Texture<class_texture>`.
  281. .. _class_TreeItem_set_icon_max_width:
  282. - void **set_icon_max_width** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)**
  283. Sets the given column's icon's maximum width.
  284. .. _class_TreeItem_set_icon_region:
  285. - void **set_icon_region** **(** :ref:`int<class_int>` column, :ref:`Rect2<class_rect2>` region **)**
  286. Sets the given column's icon's texture region.
  287. .. _class_TreeItem_set_metadata:
  288. - void **set_metadata** **(** :ref:`int<class_int>` column, :ref:`Variant<class_variant>` meta **)**
  289. .. _class_TreeItem_set_range:
  290. - void **set_range** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)**
  291. .. _class_TreeItem_set_range_config:
  292. - void **set_range_config** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step, :ref:`bool<class_bool>` expr=false **)**
  293. .. _class_TreeItem_set_selectable:
  294. - void **set_selectable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)**
  295. If ``true`` the given column is selectable.
  296. .. _class_TreeItem_set_text:
  297. - void **set_text** **(** :ref:`int<class_int>` column, :ref:`String<class_string>` text **)**
  298. .. _class_TreeItem_set_text_align:
  299. - void **set_text_align** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` text_align **)**
  300. Sets the given column's text alignment. See ``ALIGN_*`` constants.
  301. .. _class_TreeItem_set_tooltip:
  302. - void **set_tooltip** **(** :ref:`int<class_int>` column, :ref:`String<class_string>` tooltip **)**
  303. Sets the given column's tooltip text.