class_treeitem.rst 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the TreeItem.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_TreeItem:
  6. TreeItem
  7. ========
  8. **Inherits:** :ref:`Object<class_Object>`
  9. Control for a single item inside a :ref:`Tree<class_Tree>`.
  10. Description
  11. -----------
  12. Control for a single item inside a :ref:`Tree<class_Tree>`. May have child ``TreeItem``\ s and be styled as well as contain buttons.
  13. You can remove a ``TreeItem`` by using :ref:`Object.free<class_Object_method_free>`.
  14. Properties
  15. ----------
  16. +-------------------------+-----------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`collapsed<class_TreeItem_property_collapsed>` |
  18. +-------------------------+-----------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`custom_minimum_height<class_TreeItem_property_custom_minimum_height>` |
  20. +-------------------------+-----------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`disable_folding<class_TreeItem_property_disable_folding>` |
  22. +-------------------------+-----------------------------------------------------------------------------+
  23. Methods
  24. -------
  25. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`add_button<class_TreeItem_method_add_button>` **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` button, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)** |
  27. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Variant<class_Variant>` | :ref:`call_recursive<class_TreeItem_method_call_recursive>` **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  29. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`clear_custom_bg_color<class_TreeItem_method_clear_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |
  31. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`clear_custom_color<class_TreeItem_method_clear_custom_color>` **(** :ref:`int<class_int>` column **)** |
  33. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`clear_opentype_features<class_TreeItem_method_clear_opentype_features>` **(** :ref:`int<class_int>` column **)** |
  35. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`TreeItem<class_TreeItem>` | :ref:`create_child<class_TreeItem_method_create_child>` **(** :ref:`int<class_int>` idx=-1 **)** |
  37. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`deselect<class_TreeItem_method_deselect>` **(** :ref:`int<class_int>` column **)** |
  39. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`erase_button<class_TreeItem_method_erase_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |
  41. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_button<class_TreeItem_method_get_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  43. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`int<class_int>` | :ref:`get_button_by_id<class_TreeItem_method_get_button_by_id>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` id **)** |const| |
  45. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`int<class_int>` | :ref:`get_button_count<class_TreeItem_method_get_button_count>` **(** :ref:`int<class_int>` column **)** |const| |
  47. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`int<class_int>` | :ref:`get_button_id<class_TreeItem_method_get_button_id>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  49. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`String<class_String>` | :ref:`get_button_tooltip<class_TreeItem_method_get_button_tooltip>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  51. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` | :ref:`get_cell_mode<class_TreeItem_method_get_cell_mode>` **(** :ref:`int<class_int>` column **)** |const| |
  53. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_child<class_TreeItem_method_get_child>` **(** :ref:`int<class_int>` idx **)** |
  55. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_child_count<class_TreeItem_method_get_child_count>` **(** **)** |
  57. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Array<class_Array>` | :ref:`get_children<class_TreeItem_method_get_children>` **(** **)** |
  59. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Color<class_Color>` | :ref:`get_custom_bg_color<class_TreeItem_method_get_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |const| |
  61. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Color<class_Color>` | :ref:`get_custom_color<class_TreeItem_method_get_custom_color>` **(** :ref:`int<class_int>` column **)** |const| |
  63. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Font<class_Font>` | :ref:`get_custom_font<class_TreeItem_method_get_custom_font>` **(** :ref:`int<class_int>` column **)** |const| |
  65. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_custom_font_size<class_TreeItem_method_get_custom_font_size>` **(** :ref:`int<class_int>` column **)** |const| |
  67. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`get_expand_right<class_TreeItem_method_get_expand_right>` **(** :ref:`int<class_int>` column **)** |const| |
  69. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_first_child<class_TreeItem_method_get_first_child>` **(** **)** |const| |
  71. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_icon<class_TreeItem_method_get_icon>` **(** :ref:`int<class_int>` column **)** |const| |
  73. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_icon_max_width<class_TreeItem_method_get_icon_max_width>` **(** :ref:`int<class_int>` column **)** |const| |
  75. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Color<class_Color>` | :ref:`get_icon_modulate<class_TreeItem_method_get_icon_modulate>` **(** :ref:`int<class_int>` column **)** |const| |
  77. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Rect2<class_Rect2>` | :ref:`get_icon_region<class_TreeItem_method_get_icon_region>` **(** :ref:`int<class_int>` column **)** |const| |
  79. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`int<class_int>` | :ref:`get_index<class_TreeItem_method_get_index>` **(** **)** |
  81. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`String<class_String>` | :ref:`get_language<class_TreeItem_method_get_language>` **(** :ref:`int<class_int>` column **)** |const| |
  83. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Variant<class_Variant>` | :ref:`get_metadata<class_TreeItem_method_get_metadata>` **(** :ref:`int<class_int>` column **)** |const| |
  85. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next<class_TreeItem_method_get_next>` **(** **)** |const| |
  87. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_visible<class_TreeItem_method_get_next_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  89. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`int<class_int>` | :ref:`get_opentype_feature<class_TreeItem_method_get_opentype_feature>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag **)** |const| |
  91. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_parent<class_TreeItem_method_get_parent>` **(** **)** |const| |
  93. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev<class_TreeItem_method_get_prev>` **(** **)** |
  95. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_visible<class_TreeItem_method_get_prev_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  97. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`float<class_float>` | :ref:`get_range<class_TreeItem_method_get_range>` **(** :ref:`int<class_int>` column **)** |const| |
  99. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_range_config<class_TreeItem_method_get_range_config>` **(** :ref:`int<class_int>` column **)** |
  101. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` | :ref:`get_structured_text_bidi_override<class_TreeItem_method_get_structured_text_bidi_override>` **(** :ref:`int<class_int>` column **)** |const| |
  103. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`Array<class_Array>` | :ref:`get_structured_text_bidi_override_options<class_TreeItem_method_get_structured_text_bidi_override_options>` **(** :ref:`int<class_int>` column **)** |const| |
  105. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`String<class_String>` | :ref:`get_suffix<class_TreeItem_method_get_suffix>` **(** :ref:`int<class_int>` column **)** |const| |
  107. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`String<class_String>` | :ref:`get_text<class_TreeItem_method_get_text>` **(** :ref:`int<class_int>` column **)** |const| |
  109. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`get_text_alignment<class_TreeItem_method_get_text_alignment>` **(** :ref:`int<class_int>` column **)** |const| |
  111. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_text_direction<class_TreeItem_method_get_text_direction>` **(** :ref:`int<class_int>` column **)** |const| |
  113. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`String<class_String>` | :ref:`get_tooltip<class_TreeItem_method_get_tooltip>` **(** :ref:`int<class_int>` column **)** |const| |
  115. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`Tree<class_Tree>` | :ref:`get_tree<class_TreeItem_method_get_tree>` **(** **)** |const| |
  117. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`bool<class_bool>` | :ref:`is_button_disabled<class_TreeItem_method_is_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  119. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`bool<class_bool>` | :ref:`is_checked<class_TreeItem_method_is_checked>` **(** :ref:`int<class_int>` column **)** |const| |
  121. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`bool<class_bool>` | :ref:`is_custom_set_as_button<class_TreeItem_method_is_custom_set_as_button>` **(** :ref:`int<class_int>` column **)** |const| |
  123. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`bool<class_bool>` | :ref:`is_editable<class_TreeItem_method_is_editable>` **(** :ref:`int<class_int>` column **)** |
  125. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`bool<class_bool>` | :ref:`is_indeterminate<class_TreeItem_method_is_indeterminate>` **(** :ref:`int<class_int>` column **)** |const| |
  127. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`bool<class_bool>` | :ref:`is_selectable<class_TreeItem_method_is_selectable>` **(** :ref:`int<class_int>` column **)** |const| |
  129. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`bool<class_bool>` | :ref:`is_selected<class_TreeItem_method_is_selected>` **(** :ref:`int<class_int>` column **)** |
  131. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`move_after<class_TreeItem_method_move_after>` **(** :ref:`TreeItem<class_TreeItem>` item **)** |
  133. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`move_before<class_TreeItem_method_move_before>` **(** :ref:`TreeItem<class_TreeItem>` item **)** |
  135. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`propagate_check<class_TreeItem_method_propagate_check>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` emit_signal=true **)** |
  137. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`remove_child<class_TreeItem_method_remove_child>` **(** :ref:`TreeItem<class_TreeItem>` child **)** |
  139. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`select<class_TreeItem_method_select>` **(** :ref:`int<class_int>` column **)** |
  141. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`set_button<class_TreeItem_method_set_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture2D<class_Texture2D>` button **)** |
  143. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`set_button_disabled<class_TreeItem_method_set_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)** |
  145. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`set_cell_mode<class_TreeItem_method_set_cell_mode>` **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)** |
  147. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`set_checked<class_TreeItem_method_set_checked>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)** |
  149. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`set_custom_as_button<class_TreeItem_method_set_custom_as_button>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  151. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`set_custom_bg_color<class_TreeItem_method_set_custom_bg_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)** |
  153. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`set_custom_color<class_TreeItem_method_set_custom_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)** |
  155. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`set_custom_draw<class_TreeItem_method_set_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` callback **)** |
  157. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`set_custom_font<class_TreeItem_method_set_custom_font>` **(** :ref:`int<class_int>` column, :ref:`Font<class_Font>` font **)** |
  159. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | void | :ref:`set_custom_font_size<class_TreeItem_method_set_custom_font_size>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` font_size **)** |
  161. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | void | :ref:`set_editable<class_TreeItem_method_set_editable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)** |
  163. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | void | :ref:`set_expand_right<class_TreeItem_method_set_expand_right>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  165. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`set_icon<class_TreeItem_method_set_icon>` **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` texture **)** |
  167. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`set_icon_max_width<class_TreeItem_method_set_icon_max_width>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)** |
  169. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`set_icon_modulate<class_TreeItem_method_set_icon_modulate>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)** |
  171. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`set_icon_region<class_TreeItem_method_set_icon_region>` **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)** |
  173. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`set_indeterminate<class_TreeItem_method_set_indeterminate>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` indeterminate **)** |
  175. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`set_language<class_TreeItem_method_set_language>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)** |
  177. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`set_metadata<class_TreeItem_method_set_metadata>` **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)** |
  179. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | void | :ref:`set_opentype_feature<class_TreeItem_method_set_opentype_feature>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)** |
  181. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | void | :ref:`set_range<class_TreeItem_method_set_range>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)** |
  183. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`set_range_config<class_TreeItem_method_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 **)** |
  185. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`set_selectable<class_TreeItem_method_set_selectable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)** |
  187. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`set_structured_text_bidi_override<class_TreeItem_method_set_structured_text_bidi_override>` **(** :ref:`int<class_int>` column, :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` parser **)** |
  189. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`set_structured_text_bidi_override_options<class_TreeItem_method_set_structured_text_bidi_override_options>` **(** :ref:`int<class_int>` column, :ref:`Array<class_Array>` args **)** |
  191. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | void | :ref:`set_suffix<class_TreeItem_method_set_suffix>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  193. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`set_text<class_TreeItem_method_set_text>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  195. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`set_text_alignment<class_TreeItem_method_set_text_alignment>` **(** :ref:`int<class_int>` column, :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` text_alignment **)** |
  197. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | void | :ref:`set_text_direction<class_TreeItem_method_set_text_direction>` **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)** |
  199. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | void | :ref:`set_tooltip<class_TreeItem_method_set_tooltip>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)** |
  201. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | void | :ref:`uncollapse_tree<class_TreeItem_method_uncollapse_tree>` **(** **)** |
  203. +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. Enumerations
  205. ------------
  206. .. _enum_TreeItem_TreeCellMode:
  207. .. _class_TreeItem_constant_CELL_MODE_STRING:
  208. .. _class_TreeItem_constant_CELL_MODE_CHECK:
  209. .. _class_TreeItem_constant_CELL_MODE_RANGE:
  210. .. _class_TreeItem_constant_CELL_MODE_ICON:
  211. .. _class_TreeItem_constant_CELL_MODE_CUSTOM:
  212. enum **TreeCellMode**:
  213. - **CELL_MODE_STRING** = **0** --- Cell contains a string.
  214. - **CELL_MODE_CHECK** = **1** --- Cell contains a checkbox.
  215. - **CELL_MODE_RANGE** = **2** --- Cell contains a range.
  216. - **CELL_MODE_ICON** = **3** --- Cell contains an icon.
  217. - **CELL_MODE_CUSTOM** = **4**
  218. Property Descriptions
  219. ---------------------
  220. .. _class_TreeItem_property_collapsed:
  221. - :ref:`bool<class_bool>` **collapsed**
  222. +----------+----------------------+
  223. | *Setter* | set_collapsed(value) |
  224. +----------+----------------------+
  225. | *Getter* | is_collapsed() |
  226. +----------+----------------------+
  227. If ``true``, the TreeItem is collapsed.
  228. ----
  229. .. _class_TreeItem_property_custom_minimum_height:
  230. - :ref:`int<class_int>` **custom_minimum_height**
  231. +----------+----------------------------------+
  232. | *Setter* | set_custom_minimum_height(value) |
  233. +----------+----------------------------------+
  234. | *Getter* | get_custom_minimum_height() |
  235. +----------+----------------------------------+
  236. The custom minimum height.
  237. ----
  238. .. _class_TreeItem_property_disable_folding:
  239. - :ref:`bool<class_bool>` **disable_folding**
  240. +----------+----------------------------+
  241. | *Setter* | set_disable_folding(value) |
  242. +----------+----------------------------+
  243. | *Getter* | is_folding_disabled() |
  244. +----------+----------------------------+
  245. If ``true``, folding is disabled for this TreeItem.
  246. Method Descriptions
  247. -------------------
  248. .. _class_TreeItem_method_add_button:
  249. - void **add_button** **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` button, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)**
  250. Adds a button with :ref:`Texture2D<class_Texture2D>` ``button`` at column ``column``. The ``id`` is used to identify the button. If not specified, the next available index is used, which may be retrieved by calling :ref:`get_button_count<class_TreeItem_method_get_button_count>` immediately before this method. Optionally, the button can be ``disabled`` and have a ``tooltip``.
  251. ----
  252. .. _class_TreeItem_method_call_recursive:
  253. - :ref:`Variant<class_Variant>` **call_recursive** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  254. Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
  255. ----
  256. .. _class_TreeItem_method_clear_custom_bg_color:
  257. - void **clear_custom_bg_color** **(** :ref:`int<class_int>` column **)**
  258. Resets the background color for the given column to default.
  259. ----
  260. .. _class_TreeItem_method_clear_custom_color:
  261. - void **clear_custom_color** **(** :ref:`int<class_int>` column **)**
  262. Resets the color for the given column to default.
  263. ----
  264. .. _class_TreeItem_method_clear_opentype_features:
  265. - void **clear_opentype_features** **(** :ref:`int<class_int>` column **)**
  266. Removes all OpenType features.
  267. ----
  268. .. _class_TreeItem_method_create_child:
  269. - :ref:`TreeItem<class_TreeItem>` **create_child** **(** :ref:`int<class_int>` idx=-1 **)**
  270. Creates an item and adds it as a child.
  271. The new item will be inserted as position ``idx`` (the default value ``-1`` means the last position), or it will be the last child if ``idx`` is higher than the child count.
  272. ----
  273. .. _class_TreeItem_method_deselect:
  274. - void **deselect** **(** :ref:`int<class_int>` column **)**
  275. Deselects the given column.
  276. ----
  277. .. _class_TreeItem_method_erase_button:
  278. - void **erase_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)**
  279. Removes the button at index ``button_idx`` in column ``column``.
  280. ----
  281. .. _class_TreeItem_method_get_button:
  282. - :ref:`Texture2D<class_Texture2D>` **get_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  283. Returns the :ref:`Texture2D<class_Texture2D>` of the button at index ``button_idx`` in column ``column``.
  284. ----
  285. .. _class_TreeItem_method_get_button_by_id:
  286. - :ref:`int<class_int>` **get_button_by_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` id **)** |const|
  287. Returns the button index if there is a button with id ``id`` in column ``column``, otherwise returns -1.
  288. ----
  289. .. _class_TreeItem_method_get_button_count:
  290. - :ref:`int<class_int>` **get_button_count** **(** :ref:`int<class_int>` column **)** |const|
  291. Returns the number of buttons in column ``column``.
  292. ----
  293. .. _class_TreeItem_method_get_button_id:
  294. - :ref:`int<class_int>` **get_button_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  295. Returns the id for the button at index ``button_idx`` in column ``column``.
  296. ----
  297. .. _class_TreeItem_method_get_button_tooltip:
  298. - :ref:`String<class_String>` **get_button_tooltip** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  299. Returns the tooltip string for the button at index ``button_idx`` in column ``column``.
  300. ----
  301. .. _class_TreeItem_method_get_cell_mode:
  302. - :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **get_cell_mode** **(** :ref:`int<class_int>` column **)** |const|
  303. Returns the column's cell mode.
  304. ----
  305. .. _class_TreeItem_method_get_child:
  306. - :ref:`TreeItem<class_TreeItem>` **get_child** **(** :ref:`int<class_int>` idx **)**
  307. Returns a child item by its index (see :ref:`get_child_count<class_TreeItem_method_get_child_count>`). This method is often used for iterating all children of an item.
  308. Negative indices access the children from the last one.
  309. ----
  310. .. _class_TreeItem_method_get_child_count:
  311. - :ref:`int<class_int>` **get_child_count** **(** **)**
  312. Returns the number of child items.
  313. ----
  314. .. _class_TreeItem_method_get_children:
  315. - :ref:`Array<class_Array>` **get_children** **(** **)**
  316. Returns an array of references to the item's children.
  317. ----
  318. .. _class_TreeItem_method_get_custom_bg_color:
  319. - :ref:`Color<class_Color>` **get_custom_bg_color** **(** :ref:`int<class_int>` column **)** |const|
  320. Returns the custom background color of column ``column``.
  321. ----
  322. .. _class_TreeItem_method_get_custom_color:
  323. - :ref:`Color<class_Color>` **get_custom_color** **(** :ref:`int<class_int>` column **)** |const|
  324. Returns the custom color of column ``column``.
  325. ----
  326. .. _class_TreeItem_method_get_custom_font:
  327. - :ref:`Font<class_Font>` **get_custom_font** **(** :ref:`int<class_int>` column **)** |const|
  328. Returns custom font used to draw text in the column ``column``.
  329. ----
  330. .. _class_TreeItem_method_get_custom_font_size:
  331. - :ref:`int<class_int>` **get_custom_font_size** **(** :ref:`int<class_int>` column **)** |const|
  332. Returns custom font size used to draw text in the column ``column``.
  333. ----
  334. .. _class_TreeItem_method_get_expand_right:
  335. - :ref:`bool<class_bool>` **get_expand_right** **(** :ref:`int<class_int>` column **)** |const|
  336. Returns ``true`` if ``expand_right`` is set.
  337. ----
  338. .. _class_TreeItem_method_get_first_child:
  339. - :ref:`TreeItem<class_TreeItem>` **get_first_child** **(** **)** |const|
  340. Returns the TreeItem's first child.
  341. ----
  342. .. _class_TreeItem_method_get_icon:
  343. - :ref:`Texture2D<class_Texture2D>` **get_icon** **(** :ref:`int<class_int>` column **)** |const|
  344. Returns the given column's icon :ref:`Texture2D<class_Texture2D>`. Error if no icon is set.
  345. ----
  346. .. _class_TreeItem_method_get_icon_max_width:
  347. - :ref:`int<class_int>` **get_icon_max_width** **(** :ref:`int<class_int>` column **)** |const|
  348. Returns the column's icon's maximum width.
  349. ----
  350. .. _class_TreeItem_method_get_icon_modulate:
  351. - :ref:`Color<class_Color>` **get_icon_modulate** **(** :ref:`int<class_int>` column **)** |const|
  352. Returns the :ref:`Color<class_Color>` modulating the column's icon.
  353. ----
  354. .. _class_TreeItem_method_get_icon_region:
  355. - :ref:`Rect2<class_Rect2>` **get_icon_region** **(** :ref:`int<class_int>` column **)** |const|
  356. Returns the icon :ref:`Texture2D<class_Texture2D>` region as :ref:`Rect2<class_Rect2>`.
  357. ----
  358. .. _class_TreeItem_method_get_index:
  359. - :ref:`int<class_int>` **get_index** **(** **)**
  360. Returns the node's order in the tree. For example, if called on the first child item the position is ``0``.
  361. ----
  362. .. _class_TreeItem_method_get_language:
  363. - :ref:`String<class_String>` **get_language** **(** :ref:`int<class_int>` column **)** |const|
  364. Returns item's text language code.
  365. ----
  366. .. _class_TreeItem_method_get_metadata:
  367. - :ref:`Variant<class_Variant>` **get_metadata** **(** :ref:`int<class_int>` column **)** |const|
  368. Returns the metadata value that was set for the given column using :ref:`set_metadata<class_TreeItem_method_set_metadata>`.
  369. ----
  370. .. _class_TreeItem_method_get_next:
  371. - :ref:`TreeItem<class_TreeItem>` **get_next** **(** **)** |const|
  372. Returns the next TreeItem in the tree or a null object if there is none.
  373. ----
  374. .. _class_TreeItem_method_get_next_visible:
  375. - :ref:`TreeItem<class_TreeItem>` **get_next_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  376. Returns the next visible TreeItem in the tree or a null object if there is none.
  377. If ``wrap`` is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns ``null``.
  378. ----
  379. .. _class_TreeItem_method_get_opentype_feature:
  380. - :ref:`int<class_int>` **get_opentype_feature** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag **)** |const|
  381. Returns OpenType feature ``tag`` of the item's text.
  382. ----
  383. .. _class_TreeItem_method_get_parent:
  384. - :ref:`TreeItem<class_TreeItem>` **get_parent** **(** **)** |const|
  385. Returns the parent TreeItem or a null object if there is none.
  386. ----
  387. .. _class_TreeItem_method_get_prev:
  388. - :ref:`TreeItem<class_TreeItem>` **get_prev** **(** **)**
  389. Returns the previous TreeItem in the tree or a null object if there is none.
  390. ----
  391. .. _class_TreeItem_method_get_prev_visible:
  392. - :ref:`TreeItem<class_TreeItem>` **get_prev_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  393. Returns the previous visible TreeItem in the tree or a null object if there is none.
  394. If ``wrap`` is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns ``null``.
  395. ----
  396. .. _class_TreeItem_method_get_range:
  397. - :ref:`float<class_float>` **get_range** **(** :ref:`int<class_int>` column **)** |const|
  398. Returns the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  399. ----
  400. .. _class_TreeItem_method_get_range_config:
  401. - :ref:`Dictionary<class_Dictionary>` **get_range_config** **(** :ref:`int<class_int>` column **)**
  402. Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
  403. ----
  404. .. _class_TreeItem_method_get_structured_text_bidi_override:
  405. - :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` **get_structured_text_bidi_override** **(** :ref:`int<class_int>` column **)** |const|
  406. ----
  407. .. _class_TreeItem_method_get_structured_text_bidi_override_options:
  408. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options** **(** :ref:`int<class_int>` column **)** |const|
  409. ----
  410. .. _class_TreeItem_method_get_suffix:
  411. - :ref:`String<class_String>` **get_suffix** **(** :ref:`int<class_int>` column **)** |const|
  412. Gets the suffix string shown after the column value.
  413. ----
  414. .. _class_TreeItem_method_get_text:
  415. - :ref:`String<class_String>` **get_text** **(** :ref:`int<class_int>` column **)** |const|
  416. Returns the given column's text.
  417. ----
  418. .. _class_TreeItem_method_get_text_alignment:
  419. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_text_alignment** **(** :ref:`int<class_int>` column **)** |const|
  420. Returns the given column's text alignment.
  421. ----
  422. .. _class_TreeItem_method_get_text_direction:
  423. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction** **(** :ref:`int<class_int>` column **)** |const|
  424. Returns item's text base writing direction.
  425. ----
  426. .. _class_TreeItem_method_get_tooltip:
  427. - :ref:`String<class_String>` **get_tooltip** **(** :ref:`int<class_int>` column **)** |const|
  428. Returns the given column's tooltip.
  429. ----
  430. .. _class_TreeItem_method_get_tree:
  431. - :ref:`Tree<class_Tree>` **get_tree** **(** **)** |const|
  432. Returns the :ref:`Tree<class_Tree>` that owns this TreeItem.
  433. ----
  434. .. _class_TreeItem_method_is_button_disabled:
  435. - :ref:`bool<class_bool>` **is_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  436. Returns ``true`` if the button at index ``button_idx`` for the given column is disabled.
  437. ----
  438. .. _class_TreeItem_method_is_checked:
  439. - :ref:`bool<class_bool>` **is_checked** **(** :ref:`int<class_int>` column **)** |const|
  440. Returns ``true`` if the given column is checked.
  441. ----
  442. .. _class_TreeItem_method_is_custom_set_as_button:
  443. - :ref:`bool<class_bool>` **is_custom_set_as_button** **(** :ref:`int<class_int>` column **)** |const|
  444. ----
  445. .. _class_TreeItem_method_is_editable:
  446. - :ref:`bool<class_bool>` **is_editable** **(** :ref:`int<class_int>` column **)**
  447. Returns ``true`` if column ``column`` is editable.
  448. ----
  449. .. _class_TreeItem_method_is_indeterminate:
  450. - :ref:`bool<class_bool>` **is_indeterminate** **(** :ref:`int<class_int>` column **)** |const|
  451. Returns ``true`` if the given column is indeterminate.
  452. ----
  453. .. _class_TreeItem_method_is_selectable:
  454. - :ref:`bool<class_bool>` **is_selectable** **(** :ref:`int<class_int>` column **)** |const|
  455. Returns ``true`` if column ``column`` is selectable.
  456. ----
  457. .. _class_TreeItem_method_is_selected:
  458. - :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` column **)**
  459. Returns ``true`` if column ``column`` is selected.
  460. ----
  461. .. _class_TreeItem_method_move_after:
  462. - void **move_after** **(** :ref:`TreeItem<class_TreeItem>` item **)**
  463. Moves this TreeItem right after the given ``item``.
  464. \ **Note:** You can't move to the root or move the root.
  465. ----
  466. .. _class_TreeItem_method_move_before:
  467. - void **move_before** **(** :ref:`TreeItem<class_TreeItem>` item **)**
  468. Moves this TreeItem right before the given ``item``.
  469. \ **Note:** You can't move to the root or move the root.
  470. ----
  471. .. _class_TreeItem_method_propagate_check:
  472. - void **propagate_check** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` emit_signal=true **)**
  473. Propagates this item's checked status to its children and parents for the given ``column``. It is possible to process the items affected by this method call by connecting to :ref:`Tree.check_propagated_to_item<class_Tree_signal_check_propagated_to_item>`. The order that the items affected will be processed is as follows: the item invoking this method, children of that item, and finally parents of that item. If ``emit_signal`` is ``false``, then :ref:`Tree.check_propagated_to_item<class_Tree_signal_check_propagated_to_item>` will not be emitted.
  474. ----
  475. .. _class_TreeItem_method_remove_child:
  476. - void **remove_child** **(** :ref:`TreeItem<class_TreeItem>` child **)**
  477. Removes the given child ``TreeItem`` and all its children from the :ref:`Tree<class_Tree>`. Note that it doesn't free the item from memory, so it can be reused later. To completely remove a ``TreeItem`` use :ref:`Object.free<class_Object_method_free>`.
  478. ----
  479. .. _class_TreeItem_method_select:
  480. - void **select** **(** :ref:`int<class_int>` column **)**
  481. Selects the column ``column``.
  482. ----
  483. .. _class_TreeItem_method_set_button:
  484. - void **set_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture2D<class_Texture2D>` button **)**
  485. Sets the given column's button :ref:`Texture2D<class_Texture2D>` at index ``button_idx`` to ``button``.
  486. ----
  487. .. _class_TreeItem_method_set_button_disabled:
  488. - void **set_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)**
  489. If ``true``, disables the button at index ``button_idx`` in column ``column``.
  490. ----
  491. .. _class_TreeItem_method_set_cell_mode:
  492. - void **set_cell_mode** **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)**
  493. Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` constants.
  494. ----
  495. .. _class_TreeItem_method_set_checked:
  496. - void **set_checked** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)**
  497. If ``true``, the column ``column`` is checked. Clears column's indeterminate status.
  498. ----
  499. .. _class_TreeItem_method_set_custom_as_button:
  500. - void **set_custom_as_button** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  501. ----
  502. .. _class_TreeItem_method_set_custom_bg_color:
  503. - void **set_custom_bg_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)**
  504. Sets the given column's custom background color and whether to just use it as an outline.
  505. ----
  506. .. _class_TreeItem_method_set_custom_color:
  507. - void **set_custom_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)**
  508. Sets the given column's custom color.
  509. ----
  510. .. _class_TreeItem_method_set_custom_draw:
  511. - void **set_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` callback **)**
  512. Sets the given column's custom draw callback to ``callback`` method on ``object``.
  513. The ``callback`` should accept two arguments: the ``TreeItem`` that is drawn and its position and size as a :ref:`Rect2<class_Rect2>`.
  514. ----
  515. .. _class_TreeItem_method_set_custom_font:
  516. - void **set_custom_font** **(** :ref:`int<class_int>` column, :ref:`Font<class_Font>` font **)**
  517. Sets custom font used to draw text in the column ``column``.
  518. ----
  519. .. _class_TreeItem_method_set_custom_font_size:
  520. - void **set_custom_font_size** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` font_size **)**
  521. Sets custom font size used to draw text in the column ``column``.
  522. ----
  523. .. _class_TreeItem_method_set_editable:
  524. - void **set_editable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)**
  525. If ``true``, column ``column`` is editable.
  526. ----
  527. .. _class_TreeItem_method_set_expand_right:
  528. - void **set_expand_right** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  529. If ``true``, column ``column`` is expanded to the right.
  530. ----
  531. .. _class_TreeItem_method_set_icon:
  532. - void **set_icon** **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` texture **)**
  533. Sets the given column's icon :ref:`Texture2D<class_Texture2D>`.
  534. ----
  535. .. _class_TreeItem_method_set_icon_max_width:
  536. - void **set_icon_max_width** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)**
  537. Sets the given column's icon's maximum width.
  538. ----
  539. .. _class_TreeItem_method_set_icon_modulate:
  540. - void **set_icon_modulate** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)**
  541. Modulates the given column's icon with ``modulate``.
  542. ----
  543. .. _class_TreeItem_method_set_icon_region:
  544. - void **set_icon_region** **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)**
  545. Sets the given column's icon's texture region.
  546. ----
  547. .. _class_TreeItem_method_set_indeterminate:
  548. - void **set_indeterminate** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` indeterminate **)**
  549. If ``true``, the column ``column`` is marked indeterminate.
  550. \ **Note:** If set ``true`` from ``false``, then column is cleared of checked status.
  551. ----
  552. .. _class_TreeItem_method_set_language:
  553. - void **set_language** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)**
  554. Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  555. ----
  556. .. _class_TreeItem_method_set_metadata:
  557. - void **set_metadata** **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)**
  558. Sets the metadata value for the given column, which can be retrieved later using :ref:`get_metadata<class_TreeItem_method_get_metadata>`. This can be used, for example, to store a reference to the original data.
  559. ----
  560. .. _class_TreeItem_method_set_opentype_feature:
  561. - void **set_opentype_feature** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)**
  562. Sets OpenType feature ``tag`` for the item's text.
  563. ----
  564. .. _class_TreeItem_method_set_range:
  565. - void **set_range** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)**
  566. Sets the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  567. ----
  568. .. _class_TreeItem_method_set_range_config:
  569. - 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 **)**
  570. Sets the range of accepted values for a column. The column must be in the :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode.
  571. If ``expr`` is ``true``, the edit mode slider will use an exponential scale as with :ref:`Range.exp_edit<class_Range_property_exp_edit>`.
  572. ----
  573. .. _class_TreeItem_method_set_selectable:
  574. - void **set_selectable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)**
  575. If ``true``, the given column is selectable.
  576. ----
  577. .. _class_TreeItem_method_set_structured_text_bidi_override:
  578. - void **set_structured_text_bidi_override** **(** :ref:`int<class_int>` column, :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` parser **)**
  579. ----
  580. .. _class_TreeItem_method_set_structured_text_bidi_override_options:
  581. - void **set_structured_text_bidi_override_options** **(** :ref:`int<class_int>` column, :ref:`Array<class_Array>` args **)**
  582. ----
  583. .. _class_TreeItem_method_set_suffix:
  584. - void **set_suffix** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  585. Sets a string to be shown after a column's value (for example, a unit abbreviation).
  586. ----
  587. .. _class_TreeItem_method_set_text:
  588. - void **set_text** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  589. Sets the given column's text value.
  590. ----
  591. .. _class_TreeItem_method_set_text_alignment:
  592. - void **set_text_alignment** **(** :ref:`int<class_int>` column, :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` text_alignment **)**
  593. Sets the given column's text alignment. See :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` for possible values.
  594. ----
  595. .. _class_TreeItem_method_set_text_direction:
  596. - void **set_text_direction** **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)**
  597. Sets item's text base writing direction.
  598. ----
  599. .. _class_TreeItem_method_set_tooltip:
  600. - void **set_tooltip** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)**
  601. Sets the given column's tooltip text.
  602. ----
  603. .. _class_TreeItem_method_uncollapse_tree:
  604. - void **uncollapse_tree** **(** **)**
  605. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  606. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  607. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  608. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  609. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  610. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`