class_tree.rst 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Tree.xml.
  6. .. _class_Tree:
  7. Tree
  8. ====
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Control to show a tree of items.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structured displays and interactions.
  15. Trees are built via code, using :ref:`TreeItem<class_TreeItem>` objects to create the structure. They have a single root but multiple roots can be simulated if a dummy hidden root is added.
  16. .. tabs::
  17. .. code-tab:: gdscript
  18. func _ready():
  19. var tree = Tree.new()
  20. var root = tree.create_item()
  21. tree.hide_root = true
  22. var child1 = tree.create_item(root)
  23. var child2 = tree.create_item(root)
  24. var subchild1 = tree.create_item(child1)
  25. subchild1.set_text(0, "Subchild1")
  26. .. code-tab:: csharp
  27. public override void _Ready()
  28. {
  29. var tree = new Tree();
  30. TreeItem root = tree.CreateItem();
  31. tree.HideRoot = true;
  32. TreeItem child1 = tree.CreateItem(root);
  33. TreeItem child2 = tree.CreateItem(root);
  34. TreeItem subchild1 = tree.CreateItem(child1);
  35. subchild1.SetText(0, "Subchild1");
  36. }
  37. To iterate over all the :ref:`TreeItem<class_TreeItem>` objects in a **Tree** object, use :ref:`TreeItem.get_next<class_TreeItem_method_get_next>` and :ref:`TreeItem.get_first_child<class_TreeItem_method_get_first_child>` after getting the root through :ref:`get_root<class_Tree_method_get_root>`. You can use :ref:`Object.free<class_Object_method_free>` on a :ref:`TreeItem<class_TreeItem>` to remove it from the **Tree**.
  38. \ **Incremental search:** Like :ref:`ItemList<class_ItemList>` and :ref:`PopupMenu<class_PopupMenu>`, **Tree** supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing :ref:`ProjectSettings.gui/timers/incremental_search_max_interval_msec<class_ProjectSettings_property_gui/timers/incremental_search_max_interval_msec>`.
  39. .. rst-class:: classref-reftable-group
  40. Properties
  41. ----------
  42. .. table::
  43. :widths: auto
  44. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`allow_reselect<class_Tree_property_allow_reselect>` | ``false`` |
  46. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`allow_rmb_select<class_Tree_property_allow_rmb_select>` | ``false`` |
  48. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
  50. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`column_titles_visible<class_Tree_property_column_titles_visible>` | ``false`` |
  52. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`columns<class_Tree_property_columns>` | ``1`` |
  54. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  55. | :ref:`int<class_int>` | :ref:`drop_mode_flags<class_Tree_property_drop_mode_flags>` | ``0`` |
  56. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`enable_recursive_folding<class_Tree_property_enable_recursive_folding>` | ``true`` |
  58. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  59. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  60. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`hide_folding<class_Tree_property_hide_folding>` | ``false`` |
  62. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  63. | :ref:`bool<class_bool>` | :ref:`hide_root<class_Tree_property_hide_root>` | ``false`` |
  64. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`scroll_horizontal_enabled<class_Tree_property_scroll_horizontal_enabled>` | ``true`` |
  66. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`scroll_vertical_enabled<class_Tree_property_scroll_vertical_enabled>` | ``true`` |
  68. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  69. | :ref:`SelectMode<enum_Tree_SelectMode>` | :ref:`select_mode<class_Tree_property_select_mode>` | ``0`` |
  70. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  71. .. rst-class:: classref-reftable-group
  72. Methods
  73. -------
  74. .. table::
  75. :widths: auto
  76. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`clear<class_Tree_method_clear>` **(** **)** |
  78. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`TreeItem<class_TreeItem>` | :ref:`create_item<class_Tree_method_create_item>` **(** :ref:`TreeItem<class_TreeItem>` parent=null, :ref:`int<class_int>` idx=-1 **)** |
  80. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`bool<class_bool>` | :ref:`edit_selected<class_Tree_method_edit_selected>` **(** **)** |
  82. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`ensure_cursor_is_visible<class_Tree_method_ensure_cursor_is_visible>` **(** **)** |
  84. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`int<class_int>` | :ref:`get_button_id_at_position<class_Tree_method_get_button_id_at_position>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
  86. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`int<class_int>` | :ref:`get_column_at_position<class_Tree_method_get_column_at_position>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
  88. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`int<class_int>` | :ref:`get_column_expand_ratio<class_Tree_method_get_column_expand_ratio>` **(** :ref:`int<class_int>` column **)** |const| |
  90. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`String<class_String>` | :ref:`get_column_title<class_Tree_method_get_column_title>` **(** :ref:`int<class_int>` column **)** |const| |
  92. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_column_title_direction<class_Tree_method_get_column_title_direction>` **(** :ref:`int<class_int>` column **)** |const| |
  94. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`String<class_String>` | :ref:`get_column_title_language<class_Tree_method_get_column_title_language>` **(** :ref:`int<class_int>` column **)** |const| |
  96. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`get_column_width<class_Tree_method_get_column_width>` **(** :ref:`int<class_int>` column **)** |const| |
  98. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`Rect2<class_Rect2>` | :ref:`get_custom_popup_rect<class_Tree_method_get_custom_popup_rect>` **(** **)** |const| |
  100. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`int<class_int>` | :ref:`get_drop_section_at_position<class_Tree_method_get_drop_section_at_position>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
  102. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_edited<class_Tree_method_get_edited>` **(** **)** |const| |
  104. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`int<class_int>` | :ref:`get_edited_column<class_Tree_method_get_edited_column>` **(** **)** |const| |
  106. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`Rect2<class_Rect2>` | :ref:`get_item_area_rect<class_Tree_method_get_item_area_rect>` **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`int<class_int>` column=-1, :ref:`int<class_int>` button_index=-1 **)** |const| |
  108. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_item_at_position<class_Tree_method_get_item_at_position>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
  110. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_selected<class_Tree_method_get_next_selected>` **(** :ref:`TreeItem<class_TreeItem>` from **)** |
  112. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`int<class_int>` | :ref:`get_pressed_button<class_Tree_method_get_pressed_button>` **(** **)** |const| |
  114. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_root<class_Tree_method_get_root>` **(** **)** |const| |
  116. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`Vector2<class_Vector2>` | :ref:`get_scroll<class_Tree_method_get_scroll>` **(** **)** |const| |
  118. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_selected<class_Tree_method_get_selected>` **(** **)** |const| |
  120. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_selected_column<class_Tree_method_get_selected_column>` **(** **)** |const| |
  122. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`bool<class_bool>` | :ref:`is_column_clipping_content<class_Tree_method_is_column_clipping_content>` **(** :ref:`int<class_int>` column **)** |const| |
  124. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`bool<class_bool>` | :ref:`is_column_expanding<class_Tree_method_is_column_expanding>` **(** :ref:`int<class_int>` column **)** |const| |
  126. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`scroll_to_item<class_Tree_method_scroll_to_item>` **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`bool<class_bool>` center_on_item=false **)** |
  128. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`set_column_clip_content<class_Tree_method_set_column_clip_content>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  130. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`set_column_custom_minimum_width<class_Tree_method_set_column_custom_minimum_width>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` min_width **)** |
  132. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`set_column_expand<class_Tree_method_set_column_expand>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand **)** |
  134. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`set_column_expand_ratio<class_Tree_method_set_column_expand_ratio>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` ratio **)** |
  136. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`set_column_title<class_Tree_method_set_column_title>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` title **)** |
  138. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`set_column_title_direction<class_Tree_method_set_column_title_direction>` **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)** |
  140. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`set_column_title_language<class_Tree_method_set_column_title_language>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)** |
  142. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`set_selected<class_Tree_method_set_selected>` **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`int<class_int>` column **)** |
  144. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. .. rst-class:: classref-reftable-group
  146. Theme Properties
  147. ----------------
  148. .. table::
  149. :widths: auto
  150. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  151. | :ref:`Color<class_Color>` | :ref:`children_hl_line_color<class_Tree_theme_color_children_hl_line_color>` | ``Color(0.27, 0.27, 0.27, 1)`` |
  152. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  153. | :ref:`Color<class_Color>` | :ref:`custom_button_font_highlight<class_Tree_theme_color_custom_button_font_highlight>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  154. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  155. | :ref:`Color<class_Color>` | :ref:`drop_position_color<class_Tree_theme_color_drop_position_color>` | ``Color(1, 1, 1, 1)`` |
  156. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  157. | :ref:`Color<class_Color>` | :ref:`font_color<class_Tree_theme_color_font_color>` | ``Color(0.7, 0.7, 0.7, 1)`` |
  158. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  159. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_Tree_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  160. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  161. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_Tree_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
  162. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  163. | :ref:`Color<class_Color>` | :ref:`guide_color<class_Tree_theme_color_guide_color>` | ``Color(0.7, 0.7, 0.7, 0.25)`` |
  164. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  165. | :ref:`Color<class_Color>` | :ref:`parent_hl_line_color<class_Tree_theme_color_parent_hl_line_color>` | ``Color(0.27, 0.27, 0.27, 1)`` |
  166. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  167. | :ref:`Color<class_Color>` | :ref:`relationship_line_color<class_Tree_theme_color_relationship_line_color>` | ``Color(0.27, 0.27, 0.27, 1)`` |
  168. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  169. | :ref:`Color<class_Color>` | :ref:`title_button_color<class_Tree_theme_color_title_button_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  170. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  171. | :ref:`int<class_int>` | :ref:`button_margin<class_Tree_theme_constant_button_margin>` | ``4`` |
  172. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  173. | :ref:`int<class_int>` | :ref:`children_hl_line_width<class_Tree_theme_constant_children_hl_line_width>` | ``1`` |
  174. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  175. | :ref:`int<class_int>` | :ref:`draw_guides<class_Tree_theme_constant_draw_guides>` | ``1`` |
  176. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  177. | :ref:`int<class_int>` | :ref:`draw_relationship_lines<class_Tree_theme_constant_draw_relationship_lines>` | ``0`` |
  178. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  179. | :ref:`int<class_int>` | :ref:`h_separation<class_Tree_theme_constant_h_separation>` | ``4`` |
  180. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  181. | :ref:`int<class_int>` | :ref:`item_margin<class_Tree_theme_constant_item_margin>` | ``16`` |
  182. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  183. | :ref:`int<class_int>` | :ref:`outline_size<class_Tree_theme_constant_outline_size>` | ``0`` |
  184. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  185. | :ref:`int<class_int>` | :ref:`parent_hl_line_margin<class_Tree_theme_constant_parent_hl_line_margin>` | ``0`` |
  186. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  187. | :ref:`int<class_int>` | :ref:`parent_hl_line_width<class_Tree_theme_constant_parent_hl_line_width>` | ``1`` |
  188. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  189. | :ref:`int<class_int>` | :ref:`relationship_line_width<class_Tree_theme_constant_relationship_line_width>` | ``1`` |
  190. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  191. | :ref:`int<class_int>` | :ref:`scroll_border<class_Tree_theme_constant_scroll_border>` | ``4`` |
  192. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  193. | :ref:`int<class_int>` | :ref:`scroll_speed<class_Tree_theme_constant_scroll_speed>` | ``12`` |
  194. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  195. | :ref:`int<class_int>` | :ref:`v_separation<class_Tree_theme_constant_v_separation>` | ``4`` |
  196. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  197. | :ref:`Font<class_Font>` | :ref:`font<class_Tree_theme_font_font>` | |
  198. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  199. | :ref:`Font<class_Font>` | :ref:`title_button_font<class_Tree_theme_font_title_button_font>` | |
  200. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  201. | :ref:`int<class_int>` | :ref:`font_size<class_Tree_theme_font_size_font_size>` | |
  202. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  203. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow<class_Tree_theme_icon_arrow>` | |
  204. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  205. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow_collapsed<class_Tree_theme_icon_arrow_collapsed>` | |
  206. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  207. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow_collapsed_mirrored<class_Tree_theme_icon_arrow_collapsed_mirrored>` | |
  208. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  209. | :ref:`Texture2D<class_Texture2D>` | :ref:`checked<class_Tree_theme_icon_checked>` | |
  210. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  211. | :ref:`Texture2D<class_Texture2D>` | :ref:`indeterminate<class_Tree_theme_icon_indeterminate>` | |
  212. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  213. | :ref:`Texture2D<class_Texture2D>` | :ref:`select_arrow<class_Tree_theme_icon_select_arrow>` | |
  214. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  215. | :ref:`Texture2D<class_Texture2D>` | :ref:`unchecked<class_Tree_theme_icon_unchecked>` | |
  216. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  217. | :ref:`Texture2D<class_Texture2D>` | :ref:`updown<class_Tree_theme_icon_updown>` | |
  218. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  219. | :ref:`StyleBox<class_StyleBox>` | :ref:`button_pressed<class_Tree_theme_style_button_pressed>` | |
  220. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  221. | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor<class_Tree_theme_style_cursor>` | |
  222. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  223. | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor_unfocused<class_Tree_theme_style_cursor_unfocused>` | |
  224. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  225. | :ref:`StyleBox<class_StyleBox>` | :ref:`custom_button<class_Tree_theme_style_custom_button>` | |
  226. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  227. | :ref:`StyleBox<class_StyleBox>` | :ref:`custom_button_hover<class_Tree_theme_style_custom_button_hover>` | |
  228. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  229. | :ref:`StyleBox<class_StyleBox>` | :ref:`custom_button_pressed<class_Tree_theme_style_custom_button_pressed>` | |
  230. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  231. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_Tree_theme_style_focus>` | |
  232. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  233. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_Tree_theme_style_panel>` | |
  234. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  235. | :ref:`StyleBox<class_StyleBox>` | :ref:`selected<class_Tree_theme_style_selected>` | |
  236. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  237. | :ref:`StyleBox<class_StyleBox>` | :ref:`selected_focus<class_Tree_theme_style_selected_focus>` | |
  238. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  239. | :ref:`StyleBox<class_StyleBox>` | :ref:`title_button_hover<class_Tree_theme_style_title_button_hover>` | |
  240. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  241. | :ref:`StyleBox<class_StyleBox>` | :ref:`title_button_normal<class_Tree_theme_style_title_button_normal>` | |
  242. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  243. | :ref:`StyleBox<class_StyleBox>` | :ref:`title_button_pressed<class_Tree_theme_style_title_button_pressed>` | |
  244. +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+
  245. .. rst-class:: classref-section-separator
  246. ----
  247. .. rst-class:: classref-descriptions-group
  248. Signals
  249. -------
  250. .. _class_Tree_signal_button_clicked:
  251. .. rst-class:: classref-signal
  252. **button_clicked** **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`int<class_int>` column, :ref:`int<class_int>` id, :ref:`int<class_int>` mouse_button_index **)**
  253. Emitted when a button on the tree was pressed (see :ref:`TreeItem.add_button<class_TreeItem_method_add_button>`).
  254. .. rst-class:: classref-item-separator
  255. ----
  256. .. _class_Tree_signal_cell_selected:
  257. .. rst-class:: classref-signal
  258. **cell_selected** **(** **)**
  259. Emitted when a cell is selected.
  260. .. rst-class:: classref-item-separator
  261. ----
  262. .. _class_Tree_signal_check_propagated_to_item:
  263. .. rst-class:: classref-signal
  264. **check_propagated_to_item** **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`int<class_int>` column **)**
  265. Emitted when :ref:`TreeItem.propagate_check<class_TreeItem_method_propagate_check>` is called. Connect to this signal to process the items that are affected when :ref:`TreeItem.propagate_check<class_TreeItem_method_propagate_check>` is invoked. The order that the items affected will be processed is as follows: the item that invoked the method, children of that item, and finally parents of that item.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_Tree_signal_column_title_clicked:
  269. .. rst-class:: classref-signal
  270. **column_title_clicked** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` mouse_button_index **)**
  271. Emitted when a column's title is clicked with either :ref:`@GlobalScope.MOUSE_BUTTON_LEFT<class_@GlobalScope_constant_MOUSE_BUTTON_LEFT>` or :ref:`@GlobalScope.MOUSE_BUTTON_RIGHT<class_@GlobalScope_constant_MOUSE_BUTTON_RIGHT>`.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_Tree_signal_custom_item_clicked:
  275. .. rst-class:: classref-signal
  276. **custom_item_clicked** **(** :ref:`int<class_int>` mouse_button_index **)**
  277. Emitted when an item with :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` is clicked with a mouse button.
  278. .. rst-class:: classref-item-separator
  279. ----
  280. .. _class_Tree_signal_custom_popup_edited:
  281. .. rst-class:: classref-signal
  282. **custom_popup_edited** **(** :ref:`bool<class_bool>` arrow_clicked **)**
  283. Emitted when a cell with the :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` is clicked to be edited.
  284. .. rst-class:: classref-item-separator
  285. ----
  286. .. _class_Tree_signal_empty_clicked:
  287. .. rst-class:: classref-signal
  288. **empty_clicked** **(** :ref:`Vector2<class_Vector2>` position, :ref:`int<class_int>` mouse_button_index **)**
  289. Emitted when a mouse button is clicked in the empty space of the tree.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_Tree_signal_item_activated:
  293. .. rst-class:: classref-signal
  294. **item_activated** **(** **)**
  295. Emitted when an item's label is double-clicked.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_Tree_signal_item_collapsed:
  299. .. rst-class:: classref-signal
  300. **item_collapsed** **(** :ref:`TreeItem<class_TreeItem>` item **)**
  301. Emitted when an item is collapsed by a click on the folding arrow.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_Tree_signal_item_custom_button_pressed:
  305. .. rst-class:: classref-signal
  306. **item_custom_button_pressed** **(** **)**
  307. Emitted when a custom button is pressed (i.e. in a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell).
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_Tree_signal_item_double_clicked:
  311. .. rst-class:: classref-signal
  312. **item_double_clicked** **(** **)**
  313. Emitted when an item's icon is double-clicked.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_Tree_signal_item_edited:
  317. .. rst-class:: classref-signal
  318. **item_edited** **(** **)**
  319. Emitted when an item is edited.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_Tree_signal_item_mouse_selected:
  323. .. rst-class:: classref-signal
  324. **item_mouse_selected** **(** :ref:`Vector2<class_Vector2>` position, :ref:`int<class_int>` mouse_button_index **)**
  325. Emitted when an item is selected with a mouse button.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_Tree_signal_item_selected:
  329. .. rst-class:: classref-signal
  330. **item_selected** **(** **)**
  331. Emitted when an item is selected.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_Tree_signal_multi_selected:
  335. .. rst-class:: classref-signal
  336. **multi_selected** **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`int<class_int>` column, :ref:`bool<class_bool>` selected **)**
  337. Emitted instead of ``item_selected`` if ``select_mode`` is :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>`.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_Tree_signal_nothing_selected:
  341. .. rst-class:: classref-signal
  342. **nothing_selected** **(** **)**
  343. Emitted when a left mouse button click does not select any item.
  344. .. rst-class:: classref-section-separator
  345. ----
  346. .. rst-class:: classref-descriptions-group
  347. Enumerations
  348. ------------
  349. .. _enum_Tree_SelectMode:
  350. .. rst-class:: classref-enumeration
  351. enum **SelectMode**:
  352. .. _class_Tree_constant_SELECT_SINGLE:
  353. .. rst-class:: classref-enumeration-constant
  354. :ref:`SelectMode<enum_Tree_SelectMode>` **SELECT_SINGLE** = ``0``
  355. Allows selection of a single cell at a time. From the perspective of items, only a single item is allowed to be selected. And there is only one column selected in the selected item.
  356. The focus cursor is always hidden in this mode, but it is positioned at the current selection, making the currently selected item the currently focused item.
  357. .. _class_Tree_constant_SELECT_ROW:
  358. .. rst-class:: classref-enumeration-constant
  359. :ref:`SelectMode<enum_Tree_SelectMode>` **SELECT_ROW** = ``1``
  360. Allows selection of a single row at a time. From the perspective of items, only a single items is allowed to be selected. And all the columns are selected in the selected item.
  361. The focus cursor is always hidden in this mode, but it is positioned at the first column of the current selection, making the currently selected item the currently focused item.
  362. .. _class_Tree_constant_SELECT_MULTI:
  363. .. rst-class:: classref-enumeration-constant
  364. :ref:`SelectMode<enum_Tree_SelectMode>` **SELECT_MULTI** = ``2``
  365. Allows selection of multiple cells at the same time. From the perspective of items, multiple items are allowed to be selected. And there can be multiple columns selected in each selected item.
  366. The focus cursor is visible in this mode, the item or column under the cursor is not necessarily selected.
  367. .. rst-class:: classref-item-separator
  368. ----
  369. .. _enum_Tree_DropModeFlags:
  370. .. rst-class:: classref-enumeration
  371. enum **DropModeFlags**:
  372. .. _class_Tree_constant_DROP_MODE_DISABLED:
  373. .. rst-class:: classref-enumeration-constant
  374. :ref:`DropModeFlags<enum_Tree_DropModeFlags>` **DROP_MODE_DISABLED** = ``0``
  375. Disables all drop sections, but still allows to detect the "on item" drop section by :ref:`get_drop_section_at_position<class_Tree_method_get_drop_section_at_position>`.
  376. \ **Note:** This is the default flag, it has no effect when combined with other flags.
  377. .. _class_Tree_constant_DROP_MODE_ON_ITEM:
  378. .. rst-class:: classref-enumeration-constant
  379. :ref:`DropModeFlags<enum_Tree_DropModeFlags>` **DROP_MODE_ON_ITEM** = ``1``
  380. Enables the "on item" drop section. This drop section covers the entire item.
  381. When combined with :ref:`DROP_MODE_INBETWEEN<class_Tree_constant_DROP_MODE_INBETWEEN>`, this drop section halves the height and stays centered vertically.
  382. .. _class_Tree_constant_DROP_MODE_INBETWEEN:
  383. .. rst-class:: classref-enumeration-constant
  384. :ref:`DropModeFlags<enum_Tree_DropModeFlags>` **DROP_MODE_INBETWEEN** = ``2``
  385. Enables "above item" and "below item" drop sections. The "above item" drop section covers the top half of the item, and the "below item" drop section covers the bottom half.
  386. When combined with :ref:`DROP_MODE_ON_ITEM<class_Tree_constant_DROP_MODE_ON_ITEM>`, these drop sections halves the height and stays on top / bottom accordingly.
  387. .. rst-class:: classref-section-separator
  388. ----
  389. .. rst-class:: classref-descriptions-group
  390. Property Descriptions
  391. ---------------------
  392. .. _class_Tree_property_allow_reselect:
  393. .. rst-class:: classref-property
  394. :ref:`bool<class_bool>` **allow_reselect** = ``false``
  395. .. rst-class:: classref-property-setget
  396. - void **set_allow_reselect** **(** :ref:`bool<class_bool>` value **)**
  397. - :ref:`bool<class_bool>` **get_allow_reselect** **(** **)**
  398. If ``true``, the currently selected cell may be selected again.
  399. .. rst-class:: classref-item-separator
  400. ----
  401. .. _class_Tree_property_allow_rmb_select:
  402. .. rst-class:: classref-property
  403. :ref:`bool<class_bool>` **allow_rmb_select** = ``false``
  404. .. rst-class:: classref-property-setget
  405. - void **set_allow_rmb_select** **(** :ref:`bool<class_bool>` value **)**
  406. - :ref:`bool<class_bool>` **get_allow_rmb_select** **(** **)**
  407. If ``true``, a right mouse button click can select items.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_Tree_property_column_titles_visible:
  411. .. rst-class:: classref-property
  412. :ref:`bool<class_bool>` **column_titles_visible** = ``false``
  413. .. rst-class:: classref-property-setget
  414. - void **set_column_titles_visible** **(** :ref:`bool<class_bool>` value **)**
  415. - :ref:`bool<class_bool>` **are_column_titles_visible** **(** **)**
  416. If ``true``, column titles are visible.
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_Tree_property_columns:
  420. .. rst-class:: classref-property
  421. :ref:`int<class_int>` **columns** = ``1``
  422. .. rst-class:: classref-property-setget
  423. - void **set_columns** **(** :ref:`int<class_int>` value **)**
  424. - :ref:`int<class_int>` **get_columns** **(** **)**
  425. The number of columns.
  426. .. rst-class:: classref-item-separator
  427. ----
  428. .. _class_Tree_property_drop_mode_flags:
  429. .. rst-class:: classref-property
  430. :ref:`int<class_int>` **drop_mode_flags** = ``0``
  431. .. rst-class:: classref-property-setget
  432. - void **set_drop_mode_flags** **(** :ref:`int<class_int>` value **)**
  433. - :ref:`int<class_int>` **get_drop_mode_flags** **(** **)**
  434. The drop mode as an OR combination of flags. See :ref:`DropModeFlags<enum_Tree_DropModeFlags>` constants. Once dropping is done, reverts to :ref:`DROP_MODE_DISABLED<class_Tree_constant_DROP_MODE_DISABLED>`. Setting this during :ref:`Control._can_drop_data<class_Control_method__can_drop_data>` is recommended.
  435. This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_Tree_property_enable_recursive_folding:
  439. .. rst-class:: classref-property
  440. :ref:`bool<class_bool>` **enable_recursive_folding** = ``true``
  441. .. rst-class:: classref-property-setget
  442. - void **set_enable_recursive_folding** **(** :ref:`bool<class_bool>` value **)**
  443. - :ref:`bool<class_bool>` **is_recursive_folding_enabled** **(** **)**
  444. If ``true``, recursive folding is enabled for this **Tree**. Holding down Shift while clicking the fold arrow collapses or uncollapses the :ref:`TreeItem<class_TreeItem>` and all its descendants.
  445. .. rst-class:: classref-item-separator
  446. ----
  447. .. _class_Tree_property_hide_folding:
  448. .. rst-class:: classref-property
  449. :ref:`bool<class_bool>` **hide_folding** = ``false``
  450. .. rst-class:: classref-property-setget
  451. - void **set_hide_folding** **(** :ref:`bool<class_bool>` value **)**
  452. - :ref:`bool<class_bool>` **is_folding_hidden** **(** **)**
  453. If ``true``, the folding arrow is hidden.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_Tree_property_hide_root:
  457. .. rst-class:: classref-property
  458. :ref:`bool<class_bool>` **hide_root** = ``false``
  459. .. rst-class:: classref-property-setget
  460. - void **set_hide_root** **(** :ref:`bool<class_bool>` value **)**
  461. - :ref:`bool<class_bool>` **is_root_hidden** **(** **)**
  462. If ``true``, the tree's root is hidden.
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _class_Tree_property_scroll_horizontal_enabled:
  466. .. rst-class:: classref-property
  467. :ref:`bool<class_bool>` **scroll_horizontal_enabled** = ``true``
  468. .. rst-class:: classref-property-setget
  469. - void **set_h_scroll_enabled** **(** :ref:`bool<class_bool>` value **)**
  470. - :ref:`bool<class_bool>` **is_h_scroll_enabled** **(** **)**
  471. If ``true``, enables horizontal scrolling.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_Tree_property_scroll_vertical_enabled:
  475. .. rst-class:: classref-property
  476. :ref:`bool<class_bool>` **scroll_vertical_enabled** = ``true``
  477. .. rst-class:: classref-property-setget
  478. - void **set_v_scroll_enabled** **(** :ref:`bool<class_bool>` value **)**
  479. - :ref:`bool<class_bool>` **is_v_scroll_enabled** **(** **)**
  480. If ``true``, enables vertical scrolling.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_Tree_property_select_mode:
  484. .. rst-class:: classref-property
  485. :ref:`SelectMode<enum_Tree_SelectMode>` **select_mode** = ``0``
  486. .. rst-class:: classref-property-setget
  487. - void **set_select_mode** **(** :ref:`SelectMode<enum_Tree_SelectMode>` value **)**
  488. - :ref:`SelectMode<enum_Tree_SelectMode>` **get_select_mode** **(** **)**
  489. Allows single or multiple selection. See the :ref:`SelectMode<enum_Tree_SelectMode>` constants.
  490. .. rst-class:: classref-section-separator
  491. ----
  492. .. rst-class:: classref-descriptions-group
  493. Method Descriptions
  494. -------------------
  495. .. _class_Tree_method_clear:
  496. .. rst-class:: classref-method
  497. void **clear** **(** **)**
  498. Clears the tree. This removes all items.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_Tree_method_create_item:
  502. .. rst-class:: classref-method
  503. :ref:`TreeItem<class_TreeItem>` **create_item** **(** :ref:`TreeItem<class_TreeItem>` parent=null, :ref:`int<class_int>` idx=-1 **)**
  504. Creates an item in the tree and adds it as a child of ``parent``, which can be either a valid :ref:`TreeItem<class_TreeItem>` or ``null``.
  505. If ``parent`` is ``null``, the root item will be the parent, or the new item will be the root itself if the tree is empty.
  506. The new item will be the ``idx``\ th child of parent, or it will be the last child if there are not enough siblings.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_Tree_method_edit_selected:
  510. .. rst-class:: classref-method
  511. :ref:`bool<class_bool>` **edit_selected** **(** **)**
  512. Edits the selected tree item as if it was clicked. The item must be set editable with :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`. Returns ``true`` if the item could be edited. Fails if no item is selected.
  513. .. rst-class:: classref-item-separator
  514. ----
  515. .. _class_Tree_method_ensure_cursor_is_visible:
  516. .. rst-class:: classref-method
  517. void **ensure_cursor_is_visible** **(** **)**
  518. Makes the currently focused cell visible.
  519. This will scroll the tree if necessary. In :ref:`SELECT_ROW<class_Tree_constant_SELECT_ROW>` mode, this will not do horizontal scrolling, as all the cells in the selected row is focused logically.
  520. \ **Note:** Despite the name of this method, the focus cursor itself is only visible in :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode.
  521. .. rst-class:: classref-item-separator
  522. ----
  523. .. _class_Tree_method_get_button_id_at_position:
  524. .. rst-class:: classref-method
  525. :ref:`int<class_int>` **get_button_id_at_position** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
  526. Returns the button ID at ``position``, or -1 if no button is there.
  527. .. rst-class:: classref-item-separator
  528. ----
  529. .. _class_Tree_method_get_column_at_position:
  530. .. rst-class:: classref-method
  531. :ref:`int<class_int>` **get_column_at_position** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
  532. Returns the column index at ``position``, or -1 if no item is there.
  533. .. rst-class:: classref-item-separator
  534. ----
  535. .. _class_Tree_method_get_column_expand_ratio:
  536. .. rst-class:: classref-method
  537. :ref:`int<class_int>` **get_column_expand_ratio** **(** :ref:`int<class_int>` column **)** |const|
  538. Returns the expand ratio assigned to the column.
  539. .. rst-class:: classref-item-separator
  540. ----
  541. .. _class_Tree_method_get_column_title:
  542. .. rst-class:: classref-method
  543. :ref:`String<class_String>` **get_column_title** **(** :ref:`int<class_int>` column **)** |const|
  544. Returns the column's title.
  545. .. rst-class:: classref-item-separator
  546. ----
  547. .. _class_Tree_method_get_column_title_direction:
  548. .. rst-class:: classref-method
  549. :ref:`TextDirection<enum_Control_TextDirection>` **get_column_title_direction** **(** :ref:`int<class_int>` column **)** |const|
  550. Returns column title base writing direction.
  551. .. rst-class:: classref-item-separator
  552. ----
  553. .. _class_Tree_method_get_column_title_language:
  554. .. rst-class:: classref-method
  555. :ref:`String<class_String>` **get_column_title_language** **(** :ref:`int<class_int>` column **)** |const|
  556. Returns column title language code.
  557. .. rst-class:: classref-item-separator
  558. ----
  559. .. _class_Tree_method_get_column_width:
  560. .. rst-class:: classref-method
  561. :ref:`int<class_int>` **get_column_width** **(** :ref:`int<class_int>` column **)** |const|
  562. Returns the column's width in pixels.
  563. .. rst-class:: classref-item-separator
  564. ----
  565. .. _class_Tree_method_get_custom_popup_rect:
  566. .. rst-class:: classref-method
  567. :ref:`Rect2<class_Rect2>` **get_custom_popup_rect** **(** **)** |const|
  568. Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See :ref:`TreeItem.set_cell_mode<class_TreeItem_method_set_cell_mode>`.
  569. .. rst-class:: classref-item-separator
  570. ----
  571. .. _class_Tree_method_get_drop_section_at_position:
  572. .. rst-class:: classref-method
  573. :ref:`int<class_int>` **get_drop_section_at_position** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
  574. Returns the drop section at ``position``, or -100 if no item is there.
  575. Values -1, 0, or 1 will be returned for the "above item", "on item", and "below item" drop sections, respectively. See :ref:`DropModeFlags<enum_Tree_DropModeFlags>` for a description of each drop section.
  576. To get the item which the returned drop section is relative to, use :ref:`get_item_at_position<class_Tree_method_get_item_at_position>`.
  577. .. rst-class:: classref-item-separator
  578. ----
  579. .. _class_Tree_method_get_edited:
  580. .. rst-class:: classref-method
  581. :ref:`TreeItem<class_TreeItem>` **get_edited** **(** **)** |const|
  582. Returns the currently edited item. Can be used with :ref:`item_edited<class_Tree_signal_item_edited>` to get the item that was modified.
  583. .. tabs::
  584. .. code-tab:: gdscript
  585. func _ready():
  586. $Tree.item_edited.connect(on_Tree_item_edited)
  587. func on_Tree_item_edited():
  588. print($Tree.get_edited()) # This item just got edited (e.g. checked).
  589. .. code-tab:: csharp
  590. public override void _Ready()
  591. {
  592. GetNode<Tree>("Tree").ItemEdited += OnTreeItemEdited;
  593. }
  594. public void OnTreeItemEdited()
  595. {
  596. GD.Print(GetNode<Tree>("Tree").GetEdited()); // This item just got edited (e.g. checked).
  597. }
  598. .. rst-class:: classref-item-separator
  599. ----
  600. .. _class_Tree_method_get_edited_column:
  601. .. rst-class:: classref-method
  602. :ref:`int<class_int>` **get_edited_column** **(** **)** |const|
  603. Returns the column for the currently edited item.
  604. .. rst-class:: classref-item-separator
  605. ----
  606. .. _class_Tree_method_get_item_area_rect:
  607. .. rst-class:: classref-method
  608. :ref:`Rect2<class_Rect2>` **get_item_area_rect** **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`int<class_int>` column=-1, :ref:`int<class_int>` button_index=-1 **)** |const|
  609. Returns the rectangle area for the specified :ref:`TreeItem<class_TreeItem>`. If ``column`` is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned.
  610. .. rst-class:: classref-item-separator
  611. ----
  612. .. _class_Tree_method_get_item_at_position:
  613. .. rst-class:: classref-method
  614. :ref:`TreeItem<class_TreeItem>` **get_item_at_position** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
  615. Returns the tree item at the specified position (relative to the tree origin position).
  616. .. rst-class:: classref-item-separator
  617. ----
  618. .. _class_Tree_method_get_next_selected:
  619. .. rst-class:: classref-method
  620. :ref:`TreeItem<class_TreeItem>` **get_next_selected** **(** :ref:`TreeItem<class_TreeItem>` from **)**
  621. Returns the next selected :ref:`TreeItem<class_TreeItem>` after the given one, or ``null`` if the end is reached.
  622. If ``from`` is ``null``, this returns the first selected item.
  623. .. rst-class:: classref-item-separator
  624. ----
  625. .. _class_Tree_method_get_pressed_button:
  626. .. rst-class:: classref-method
  627. :ref:`int<class_int>` **get_pressed_button** **(** **)** |const|
  628. Returns the last pressed button's index.
  629. .. rst-class:: classref-item-separator
  630. ----
  631. .. _class_Tree_method_get_root:
  632. .. rst-class:: classref-method
  633. :ref:`TreeItem<class_TreeItem>` **get_root** **(** **)** |const|
  634. Returns the tree's root item, or ``null`` if the tree is empty.
  635. .. rst-class:: classref-item-separator
  636. ----
  637. .. _class_Tree_method_get_scroll:
  638. .. rst-class:: classref-method
  639. :ref:`Vector2<class_Vector2>` **get_scroll** **(** **)** |const|
  640. Returns the current scrolling position.
  641. .. rst-class:: classref-item-separator
  642. ----
  643. .. _class_Tree_method_get_selected:
  644. .. rst-class:: classref-method
  645. :ref:`TreeItem<class_TreeItem>` **get_selected** **(** **)** |const|
  646. Returns the currently focused item, or ``null`` if no item is focused.
  647. In :ref:`SELECT_ROW<class_Tree_constant_SELECT_ROW>` and :ref:`SELECT_SINGLE<class_Tree_constant_SELECT_SINGLE>` modes, the focused item is same as the selected item. In :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode, the focused item is the item under the focus cursor, not necessarily selected.
  648. To get the currently selected item(s), use :ref:`get_next_selected<class_Tree_method_get_next_selected>`.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _class_Tree_method_get_selected_column:
  652. .. rst-class:: classref-method
  653. :ref:`int<class_int>` **get_selected_column** **(** **)** |const|
  654. Returns the currently focused column, or -1 if no column is focused.
  655. In :ref:`SELECT_SINGLE<class_Tree_constant_SELECT_SINGLE>` mode, the focused column is the selected column. In :ref:`SELECT_ROW<class_Tree_constant_SELECT_ROW>` mode, the focused column is always 0 if any item is selected. In :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode, the focused column is the column under the focus cursor, and there are not necessarily any column selected.
  656. To tell whether a column of an item is selected, use :ref:`TreeItem.is_selected<class_TreeItem_method_is_selected>`.
  657. .. rst-class:: classref-item-separator
  658. ----
  659. .. _class_Tree_method_is_column_clipping_content:
  660. .. rst-class:: classref-method
  661. :ref:`bool<class_bool>` **is_column_clipping_content** **(** :ref:`int<class_int>` column **)** |const|
  662. Returns ``true`` if the column has enabled clipping (see :ref:`set_column_clip_content<class_Tree_method_set_column_clip_content>`).
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_Tree_method_is_column_expanding:
  666. .. rst-class:: classref-method
  667. :ref:`bool<class_bool>` **is_column_expanding** **(** :ref:`int<class_int>` column **)** |const|
  668. Returns ``true`` if the column has enabled expanding (see :ref:`set_column_expand<class_Tree_method_set_column_expand>`).
  669. .. rst-class:: classref-item-separator
  670. ----
  671. .. _class_Tree_method_scroll_to_item:
  672. .. rst-class:: classref-method
  673. void **scroll_to_item** **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`bool<class_bool>` center_on_item=false **)**
  674. Causes the **Tree** to jump to the specified :ref:`TreeItem<class_TreeItem>`.
  675. .. rst-class:: classref-item-separator
  676. ----
  677. .. _class_Tree_method_set_column_clip_content:
  678. .. rst-class:: classref-method
  679. void **set_column_clip_content** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  680. Allows to enable clipping for column's content, making the content size ignored.
  681. .. rst-class:: classref-item-separator
  682. ----
  683. .. _class_Tree_method_set_column_custom_minimum_width:
  684. .. rst-class:: classref-method
  685. void **set_column_custom_minimum_width** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` min_width **)**
  686. Overrides the calculated minimum width of a column. It can be set to ``0`` to restore the default behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to :ref:`Control.size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>`.
  687. .. rst-class:: classref-item-separator
  688. ----
  689. .. _class_Tree_method_set_column_expand:
  690. .. rst-class:: classref-method
  691. void **set_column_expand** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand **)**
  692. If ``true``, the column will have the "Expand" flag of :ref:`Control<class_Control>`. Columns that have the "Expand" flag will use their expand ratio in a similar fashion to :ref:`Control.size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>` (see :ref:`set_column_expand_ratio<class_Tree_method_set_column_expand_ratio>`).
  693. .. rst-class:: classref-item-separator
  694. ----
  695. .. _class_Tree_method_set_column_expand_ratio:
  696. .. rst-class:: classref-method
  697. void **set_column_expand_ratio** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` ratio **)**
  698. Sets the relative expand ratio for a column. See :ref:`set_column_expand<class_Tree_method_set_column_expand>`.
  699. .. rst-class:: classref-item-separator
  700. ----
  701. .. _class_Tree_method_set_column_title:
  702. .. rst-class:: classref-method
  703. void **set_column_title** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` title **)**
  704. Sets the title of a column.
  705. .. rst-class:: classref-item-separator
  706. ----
  707. .. _class_Tree_method_set_column_title_direction:
  708. .. rst-class:: classref-method
  709. void **set_column_title_direction** **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)**
  710. Sets column title base writing direction.
  711. .. rst-class:: classref-item-separator
  712. ----
  713. .. _class_Tree_method_set_column_title_language:
  714. .. rst-class:: classref-method
  715. void **set_column_title_language** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)**
  716. Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  717. .. rst-class:: classref-item-separator
  718. ----
  719. .. _class_Tree_method_set_selected:
  720. .. rst-class:: classref-method
  721. void **set_selected** **(** :ref:`TreeItem<class_TreeItem>` item, :ref:`int<class_int>` column **)**
  722. Selects the specified :ref:`TreeItem<class_TreeItem>` and column.
  723. .. rst-class:: classref-section-separator
  724. ----
  725. .. rst-class:: classref-descriptions-group
  726. Theme Property Descriptions
  727. ---------------------------
  728. .. _class_Tree_theme_color_children_hl_line_color:
  729. .. rst-class:: classref-themeproperty
  730. :ref:`Color<class_Color>` **children_hl_line_color** = ``Color(0.27, 0.27, 0.27, 1)``
  731. The :ref:`Color<class_Color>` of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its children.
  732. .. rst-class:: classref-item-separator
  733. ----
  734. .. _class_Tree_theme_color_custom_button_font_highlight:
  735. .. rst-class:: classref-themeproperty
  736. :ref:`Color<class_Color>` **custom_button_font_highlight** = ``Color(0.95, 0.95, 0.95, 1)``
  737. Text :ref:`Color<class_Color>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell when it's hovered.
  738. .. rst-class:: classref-item-separator
  739. ----
  740. .. _class_Tree_theme_color_drop_position_color:
  741. .. rst-class:: classref-themeproperty
  742. :ref:`Color<class_Color>` **drop_position_color** = ``Color(1, 1, 1, 1)``
  743. :ref:`Color<class_Color>` used to draw possible drop locations. See :ref:`DropModeFlags<enum_Tree_DropModeFlags>` constants for further description of drop locations.
  744. .. rst-class:: classref-item-separator
  745. ----
  746. .. _class_Tree_theme_color_font_color:
  747. .. rst-class:: classref-themeproperty
  748. :ref:`Color<class_Color>` **font_color** = ``Color(0.7, 0.7, 0.7, 1)``
  749. Default text :ref:`Color<class_Color>` of the item.
  750. .. rst-class:: classref-item-separator
  751. ----
  752. .. _class_Tree_theme_color_font_outline_color:
  753. .. rst-class:: classref-themeproperty
  754. :ref:`Color<class_Color>` **font_outline_color** = ``Color(1, 1, 1, 1)``
  755. The tint of text outline of the item.
  756. .. rst-class:: classref-item-separator
  757. ----
  758. .. _class_Tree_theme_color_font_selected_color:
  759. .. rst-class:: classref-themeproperty
  760. :ref:`Color<class_Color>` **font_selected_color** = ``Color(1, 1, 1, 1)``
  761. Text :ref:`Color<class_Color>` used when the item is selected.
  762. .. rst-class:: classref-item-separator
  763. ----
  764. .. _class_Tree_theme_color_guide_color:
  765. .. rst-class:: classref-themeproperty
  766. :ref:`Color<class_Color>` **guide_color** = ``Color(0.7, 0.7, 0.7, 0.25)``
  767. :ref:`Color<class_Color>` of the guideline.
  768. .. rst-class:: classref-item-separator
  769. ----
  770. .. _class_Tree_theme_color_parent_hl_line_color:
  771. .. rst-class:: classref-themeproperty
  772. :ref:`Color<class_Color>` **parent_hl_line_color** = ``Color(0.27, 0.27, 0.27, 1)``
  773. The :ref:`Color<class_Color>` of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its parents.
  774. .. rst-class:: classref-item-separator
  775. ----
  776. .. _class_Tree_theme_color_relationship_line_color:
  777. .. rst-class:: classref-themeproperty
  778. :ref:`Color<class_Color>` **relationship_line_color** = ``Color(0.27, 0.27, 0.27, 1)``
  779. The default :ref:`Color<class_Color>` of the relationship lines.
  780. .. rst-class:: classref-item-separator
  781. ----
  782. .. _class_Tree_theme_color_title_button_color:
  783. .. rst-class:: classref-themeproperty
  784. :ref:`Color<class_Color>` **title_button_color** = ``Color(0.875, 0.875, 0.875, 1)``
  785. Default text :ref:`Color<class_Color>` of the title button.
  786. .. rst-class:: classref-item-separator
  787. ----
  788. .. _class_Tree_theme_constant_button_margin:
  789. .. rst-class:: classref-themeproperty
  790. :ref:`int<class_int>` **button_margin** = ``4``
  791. The horizontal space between each button in a cell.
  792. .. rst-class:: classref-item-separator
  793. ----
  794. .. _class_Tree_theme_constant_children_hl_line_width:
  795. .. rst-class:: classref-themeproperty
  796. :ref:`int<class_int>` **children_hl_line_width** = ``1``
  797. The width of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its children.
  798. .. rst-class:: classref-item-separator
  799. ----
  800. .. _class_Tree_theme_constant_draw_guides:
  801. .. rst-class:: classref-themeproperty
  802. :ref:`int<class_int>` **draw_guides** = ``1``
  803. Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item.
  804. .. rst-class:: classref-item-separator
  805. ----
  806. .. _class_Tree_theme_constant_draw_relationship_lines:
  807. .. rst-class:: classref-themeproperty
  808. :ref:`int<class_int>` **draw_relationship_lines** = ``0``
  809. Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy.
  810. .. rst-class:: classref-item-separator
  811. ----
  812. .. _class_Tree_theme_constant_h_separation:
  813. .. rst-class:: classref-themeproperty
  814. :ref:`int<class_int>` **h_separation** = ``4``
  815. The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled.
  816. .. rst-class:: classref-item-separator
  817. ----
  818. .. _class_Tree_theme_constant_item_margin:
  819. .. rst-class:: classref-themeproperty
  820. :ref:`int<class_int>` **item_margin** = ``16``
  821. The horizontal margin at the start of an item. This is used when folding is enabled for the item.
  822. .. rst-class:: classref-item-separator
  823. ----
  824. .. _class_Tree_theme_constant_outline_size:
  825. .. rst-class:: classref-themeproperty
  826. :ref:`int<class_int>` **outline_size** = ``0``
  827. The size of the text outline.
  828. .. rst-class:: classref-item-separator
  829. ----
  830. .. _class_Tree_theme_constant_parent_hl_line_margin:
  831. .. rst-class:: classref-themeproperty
  832. :ref:`int<class_int>` **parent_hl_line_margin** = ``0``
  833. The space between the parent relationship lines for the selected :ref:`TreeItem<class_TreeItem>` and the relationship lines to its siblings that are not selected.
  834. .. rst-class:: classref-item-separator
  835. ----
  836. .. _class_Tree_theme_constant_parent_hl_line_width:
  837. .. rst-class:: classref-themeproperty
  838. :ref:`int<class_int>` **parent_hl_line_width** = ``1``
  839. The width of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its parents.
  840. .. rst-class:: classref-item-separator
  841. ----
  842. .. _class_Tree_theme_constant_relationship_line_width:
  843. .. rst-class:: classref-themeproperty
  844. :ref:`int<class_int>` **relationship_line_width** = ``1``
  845. The default width of the relationship lines.
  846. .. rst-class:: classref-item-separator
  847. ----
  848. .. _class_Tree_theme_constant_scroll_border:
  849. .. rst-class:: classref-themeproperty
  850. :ref:`int<class_int>` **scroll_border** = ``4``
  851. The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging.
  852. .. rst-class:: classref-item-separator
  853. ----
  854. .. _class_Tree_theme_constant_scroll_speed:
  855. .. rst-class:: classref-themeproperty
  856. :ref:`int<class_int>` **scroll_speed** = ``12``
  857. The speed of border scrolling.
  858. .. rst-class:: classref-item-separator
  859. ----
  860. .. _class_Tree_theme_constant_v_separation:
  861. .. rst-class:: classref-themeproperty
  862. :ref:`int<class_int>` **v_separation** = ``4``
  863. The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border.
  864. .. rst-class:: classref-item-separator
  865. ----
  866. .. _class_Tree_theme_font_font:
  867. .. rst-class:: classref-themeproperty
  868. :ref:`Font<class_Font>` **font**
  869. :ref:`Font<class_Font>` of the item's text.
  870. .. rst-class:: classref-item-separator
  871. ----
  872. .. _class_Tree_theme_font_title_button_font:
  873. .. rst-class:: classref-themeproperty
  874. :ref:`Font<class_Font>` **title_button_font**
  875. :ref:`Font<class_Font>` of the title button's text.
  876. .. rst-class:: classref-item-separator
  877. ----
  878. .. _class_Tree_theme_font_size_font_size:
  879. .. rst-class:: classref-themeproperty
  880. :ref:`int<class_int>` **font_size**
  881. Font size of the item's text.
  882. .. rst-class:: classref-item-separator
  883. ----
  884. .. _class_Tree_theme_icon_arrow:
  885. .. rst-class:: classref-themeproperty
  886. :ref:`Texture2D<class_Texture2D>` **arrow**
  887. The arrow icon used when a foldable item is not collapsed.
  888. .. rst-class:: classref-item-separator
  889. ----
  890. .. _class_Tree_theme_icon_arrow_collapsed:
  891. .. rst-class:: classref-themeproperty
  892. :ref:`Texture2D<class_Texture2D>` **arrow_collapsed**
  893. The arrow icon used when a foldable item is collapsed (for left-to-right layouts).
  894. .. rst-class:: classref-item-separator
  895. ----
  896. .. _class_Tree_theme_icon_arrow_collapsed_mirrored:
  897. .. rst-class:: classref-themeproperty
  898. :ref:`Texture2D<class_Texture2D>` **arrow_collapsed_mirrored**
  899. The arrow icon used when a foldable item is collapsed (for right-to-left layouts).
  900. .. rst-class:: classref-item-separator
  901. ----
  902. .. _class_Tree_theme_icon_checked:
  903. .. rst-class:: classref-themeproperty
  904. :ref:`Texture2D<class_Texture2D>` **checked**
  905. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is checked.
  906. .. rst-class:: classref-item-separator
  907. ----
  908. .. _class_Tree_theme_icon_indeterminate:
  909. .. rst-class:: classref-themeproperty
  910. :ref:`Texture2D<class_Texture2D>` **indeterminate**
  911. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is indeterminate.
  912. .. rst-class:: classref-item-separator
  913. ----
  914. .. _class_Tree_theme_icon_select_arrow:
  915. .. rst-class:: classref-themeproperty
  916. :ref:`Texture2D<class_Texture2D>` **select_arrow**
  917. The arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode cell.
  918. .. rst-class:: classref-item-separator
  919. ----
  920. .. _class_Tree_theme_icon_unchecked:
  921. .. rst-class:: classref-themeproperty
  922. :ref:`Texture2D<class_Texture2D>` **unchecked**
  923. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is unchecked.
  924. .. rst-class:: classref-item-separator
  925. ----
  926. .. _class_Tree_theme_icon_updown:
  927. .. rst-class:: classref-themeproperty
  928. :ref:`Texture2D<class_Texture2D>` **updown**
  929. The updown arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode cell.
  930. .. rst-class:: classref-item-separator
  931. ----
  932. .. _class_Tree_theme_style_button_pressed:
  933. .. rst-class:: classref-themeproperty
  934. :ref:`StyleBox<class_StyleBox>` **button_pressed**
  935. :ref:`StyleBox<class_StyleBox>` used when a button in the tree is pressed.
  936. .. rst-class:: classref-item-separator
  937. ----
  938. .. _class_Tree_theme_style_cursor:
  939. .. rst-class:: classref-themeproperty
  940. :ref:`StyleBox<class_StyleBox>` **cursor**
  941. :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **Tree** is being focused.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_Tree_theme_style_cursor_unfocused:
  945. .. rst-class:: classref-themeproperty
  946. :ref:`StyleBox<class_StyleBox>` **cursor_unfocused**
  947. :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **Tree** is not being focused.
  948. .. rst-class:: classref-item-separator
  949. ----
  950. .. _class_Tree_theme_style_custom_button:
  951. .. rst-class:: classref-themeproperty
  952. :ref:`StyleBox<class_StyleBox>` **custom_button**
  953. Default :ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell.
  954. .. rst-class:: classref-item-separator
  955. ----
  956. .. _class_Tree_theme_style_custom_button_hover:
  957. .. rst-class:: classref-themeproperty
  958. :ref:`StyleBox<class_StyleBox>` **custom_button_hover**
  959. :ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell when it's hovered.
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_Tree_theme_style_custom_button_pressed:
  963. .. rst-class:: classref-themeproperty
  964. :ref:`StyleBox<class_StyleBox>` **custom_button_pressed**
  965. :ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell when it's pressed.
  966. .. rst-class:: classref-item-separator
  967. ----
  968. .. _class_Tree_theme_style_focus:
  969. .. rst-class:: classref-themeproperty
  970. :ref:`StyleBox<class_StyleBox>` **focus**
  971. The focused style for the **Tree**, drawn on top of everything.
  972. .. rst-class:: classref-item-separator
  973. ----
  974. .. _class_Tree_theme_style_panel:
  975. .. rst-class:: classref-themeproperty
  976. :ref:`StyleBox<class_StyleBox>` **panel**
  977. The background style for the **Tree**.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_Tree_theme_style_selected:
  981. .. rst-class:: classref-themeproperty
  982. :ref:`StyleBox<class_StyleBox>` **selected**
  983. :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **Tree** is not being focused.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_Tree_theme_style_selected_focus:
  987. .. rst-class:: classref-themeproperty
  988. :ref:`StyleBox<class_StyleBox>` **selected_focus**
  989. :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **Tree** is being focused.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_Tree_theme_style_title_button_hover:
  993. .. rst-class:: classref-themeproperty
  994. :ref:`StyleBox<class_StyleBox>` **title_button_hover**
  995. :ref:`StyleBox<class_StyleBox>` used when the title button is being hovered.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_Tree_theme_style_title_button_normal:
  999. .. rst-class:: classref-themeproperty
  1000. :ref:`StyleBox<class_StyleBox>` **title_button_normal**
  1001. Default :ref:`StyleBox<class_StyleBox>` for the title button.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_Tree_theme_style_title_button_pressed:
  1005. .. rst-class:: classref-themeproperty
  1006. :ref:`StyleBox<class_StyleBox>` **title_button_pressed**
  1007. :ref:`StyleBox<class_StyleBox>` used when the title button is being pressed.
  1008. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1009. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1010. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1011. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1012. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1013. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`