class_tree.rst 114 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263
  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. A control used to show a set of internal :ref:`TreeItem<class_TreeItem>`\ s in a hierarchical structure.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A control used to show a set of internal :ref:`TreeItem<class_TreeItem>`\ s in a hierarchical structure. The tree items can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like :ref:`LineEdit<class_LineEdit>`\ s, 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 with :ref:`hide_root<class_Tree_property_hide_root>`:
  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>` | :ref:`allow_search<class_Tree_property_allow_search>` | ``true`` |
  50. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`auto_tooltip<class_Tree_property_auto_tooltip>` | ``true`` |
  52. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
  54. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`column_titles_visible<class_Tree_property_column_titles_visible>` | ``false`` |
  56. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  57. | :ref:`int<class_int>` | :ref:`columns<class_Tree_property_columns>` | ``1`` |
  58. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  59. | :ref:`int<class_int>` | :ref:`drop_mode_flags<class_Tree_property_drop_mode_flags>` | ``0`` |
  60. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`enable_drag_unfolding<class_Tree_property_enable_drag_unfolding>` | ``true`` |
  62. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  63. | :ref:`bool<class_bool>` | :ref:`enable_recursive_folding<class_Tree_property_enable_recursive_folding>` | ``true`` |
  64. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  65. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  66. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`hide_folding<class_Tree_property_hide_folding>` | ``false`` |
  68. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  69. | :ref:`bool<class_bool>` | :ref:`hide_root<class_Tree_property_hide_root>` | ``false`` |
  70. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`scroll_horizontal_enabled<class_Tree_property_scroll_horizontal_enabled>` | ``true`` |
  72. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`scroll_vertical_enabled<class_Tree_property_scroll_vertical_enabled>` | ``true`` |
  74. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  75. | :ref:`SelectMode<enum_Tree_SelectMode>` | :ref:`select_mode<class_Tree_property_select_mode>` | ``0`` |
  76. +------------------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  77. .. rst-class:: classref-reftable-group
  78. Methods
  79. -------
  80. .. table::
  81. :widths: auto
  82. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | |void| | :ref:`clear<class_Tree_method_clear>`\ (\ ) |
  84. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`TreeItem<class_TreeItem>` | :ref:`create_item<class_Tree_method_create_item>`\ (\ parent\: :ref:`TreeItem<class_TreeItem>` = null, index\: :ref:`int<class_int>` = -1\ ) |
  86. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | |void| | :ref:`deselect_all<class_Tree_method_deselect_all>`\ (\ ) |
  88. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`bool<class_bool>` | :ref:`edit_selected<class_Tree_method_edit_selected>`\ (\ force_edit\: :ref:`bool<class_bool>` = false\ ) |
  90. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | |void| | :ref:`ensure_cursor_is_visible<class_Tree_method_ensure_cursor_is_visible>`\ (\ ) |
  92. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`int<class_int>` | :ref:`get_button_id_at_position<class_Tree_method_get_button_id_at_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  94. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`int<class_int>` | :ref:`get_column_at_position<class_Tree_method_get_column_at_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  96. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`get_column_expand_ratio<class_Tree_method_get_column_expand_ratio>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  98. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`String<class_String>` | :ref:`get_column_title<class_Tree_method_get_column_title>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  100. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`get_column_title_alignment<class_Tree_method_get_column_title_alignment>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  102. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_column_title_direction<class_Tree_method_get_column_title_direction>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  104. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`String<class_String>` | :ref:`get_column_title_language<class_Tree_method_get_column_title_language>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  106. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`String<class_String>` | :ref:`get_column_title_tooltip_text<class_Tree_method_get_column_title_tooltip_text>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  108. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`int<class_int>` | :ref:`get_column_width<class_Tree_method_get_column_width>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  110. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`Rect2<class_Rect2>` | :ref:`get_custom_popup_rect<class_Tree_method_get_custom_popup_rect>`\ (\ ) |const| |
  112. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`int<class_int>` | :ref:`get_drop_section_at_position<class_Tree_method_get_drop_section_at_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  114. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_edited<class_Tree_method_get_edited>`\ (\ ) |const| |
  116. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`int<class_int>` | :ref:`get_edited_column<class_Tree_method_get_edited_column>`\ (\ ) |const| |
  118. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`Rect2<class_Rect2>` | :ref:`get_item_area_rect<class_Tree_method_get_item_area_rect>`\ (\ item\: :ref:`TreeItem<class_TreeItem>`, column\: :ref:`int<class_int>` = -1, button_index\: :ref:`int<class_int>` = -1\ ) |const| |
  120. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_item_at_position<class_Tree_method_get_item_at_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  122. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_selected<class_Tree_method_get_next_selected>`\ (\ from\: :ref:`TreeItem<class_TreeItem>`\ ) |
  124. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`int<class_int>` | :ref:`get_pressed_button<class_Tree_method_get_pressed_button>`\ (\ ) |const| |
  126. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_root<class_Tree_method_get_root>`\ (\ ) |const| |
  128. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`Vector2<class_Vector2>` | :ref:`get_scroll<class_Tree_method_get_scroll>`\ (\ ) |const| |
  130. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_selected<class_Tree_method_get_selected>`\ (\ ) |const| |
  132. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`int<class_int>` | :ref:`get_selected_column<class_Tree_method_get_selected_column>`\ (\ ) |const| |
  134. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`is_column_clipping_content<class_Tree_method_is_column_clipping_content>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  136. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`bool<class_bool>` | :ref:`is_column_expanding<class_Tree_method_is_column_expanding>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
  138. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | |void| | :ref:`scroll_to_item<class_Tree_method_scroll_to_item>`\ (\ item\: :ref:`TreeItem<class_TreeItem>`, center_on_item\: :ref:`bool<class_bool>` = false\ ) |
  140. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | |void| | :ref:`set_column_clip_content<class_Tree_method_set_column_clip_content>`\ (\ column\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
  142. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | |void| | :ref:`set_column_custom_minimum_width<class_Tree_method_set_column_custom_minimum_width>`\ (\ column\: :ref:`int<class_int>`, min_width\: :ref:`int<class_int>`\ ) |
  144. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | |void| | :ref:`set_column_expand<class_Tree_method_set_column_expand>`\ (\ column\: :ref:`int<class_int>`, expand\: :ref:`bool<class_bool>`\ ) |
  146. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | |void| | :ref:`set_column_expand_ratio<class_Tree_method_set_column_expand_ratio>`\ (\ column\: :ref:`int<class_int>`, ratio\: :ref:`int<class_int>`\ ) |
  148. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | |void| | :ref:`set_column_title<class_Tree_method_set_column_title>`\ (\ column\: :ref:`int<class_int>`, title\: :ref:`String<class_String>`\ ) |
  150. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | |void| | :ref:`set_column_title_alignment<class_Tree_method_set_column_title_alignment>`\ (\ column\: :ref:`int<class_int>`, title_alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ ) |
  152. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | |void| | :ref:`set_column_title_direction<class_Tree_method_set_column_title_direction>`\ (\ column\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) |
  154. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | |void| | :ref:`set_column_title_language<class_Tree_method_set_column_title_language>`\ (\ column\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) |
  156. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | |void| | :ref:`set_column_title_tooltip_text<class_Tree_method_set_column_title_tooltip_text>`\ (\ column\: :ref:`int<class_int>`, tooltip_text\: :ref:`String<class_String>`\ ) |
  158. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | |void| | :ref:`set_selected<class_Tree_method_set_selected>`\ (\ item\: :ref:`TreeItem<class_TreeItem>`, column\: :ref:`int<class_int>`\ ) |
  160. +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. .. rst-class:: classref-reftable-group
  162. Theme Properties
  163. ----------------
  164. .. table::
  165. :widths: auto
  166. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  167. | :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)`` |
  168. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  169. | :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)`` |
  170. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  171. | :ref:`Color<class_Color>` | :ref:`drop_position_color<class_Tree_theme_color_drop_position_color>` | ``Color(1, 1, 1, 1)`` |
  172. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  173. | :ref:`Color<class_Color>` | :ref:`font_color<class_Tree_theme_color_font_color>` | ``Color(0.7, 0.7, 0.7, 1)`` |
  174. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  175. | :ref:`Color<class_Color>` | :ref:`font_disabled_color<class_Tree_theme_color_font_disabled_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  176. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  177. | :ref:`Color<class_Color>` | :ref:`font_hovered_color<class_Tree_theme_color_font_hovered_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  178. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  179. | :ref:`Color<class_Color>` | :ref:`font_hovered_dimmed_color<class_Tree_theme_color_font_hovered_dimmed_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  180. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  181. | :ref:`Color<class_Color>` | :ref:`font_hovered_selected_color<class_Tree_theme_color_font_hovered_selected_color>` | ``Color(1, 1, 1, 1)`` |
  182. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  183. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_Tree_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
  184. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  185. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_Tree_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
  186. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  187. | :ref:`Color<class_Color>` | :ref:`guide_color<class_Tree_theme_color_guide_color>` | ``Color(0.7, 0.7, 0.7, 0.25)`` |
  188. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  189. | :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)`` |
  190. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  191. | :ref:`Color<class_Color>` | :ref:`relationship_line_color<class_Tree_theme_color_relationship_line_color>` | ``Color(0.27, 0.27, 0.27, 1)`` |
  192. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  193. | :ref:`Color<class_Color>` | :ref:`title_button_color<class_Tree_theme_color_title_button_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  194. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  195. | :ref:`int<class_int>` | :ref:`button_margin<class_Tree_theme_constant_button_margin>` | ``4`` |
  196. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  197. | :ref:`int<class_int>` | :ref:`children_hl_line_width<class_Tree_theme_constant_children_hl_line_width>` | ``1`` |
  198. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  199. | :ref:`int<class_int>` | :ref:`dragging_unfold_wait_msec<class_Tree_theme_constant_dragging_unfold_wait_msec>` | ``500`` |
  200. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  201. | :ref:`int<class_int>` | :ref:`draw_guides<class_Tree_theme_constant_draw_guides>` | ``1`` |
  202. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  203. | :ref:`int<class_int>` | :ref:`draw_relationship_lines<class_Tree_theme_constant_draw_relationship_lines>` | ``0`` |
  204. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  205. | :ref:`int<class_int>` | :ref:`h_separation<class_Tree_theme_constant_h_separation>` | ``4`` |
  206. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  207. | :ref:`int<class_int>` | :ref:`icon_max_width<class_Tree_theme_constant_icon_max_width>` | ``0`` |
  208. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  209. | :ref:`int<class_int>` | :ref:`inner_item_margin_bottom<class_Tree_theme_constant_inner_item_margin_bottom>` | ``0`` |
  210. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  211. | :ref:`int<class_int>` | :ref:`inner_item_margin_left<class_Tree_theme_constant_inner_item_margin_left>` | ``0`` |
  212. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  213. | :ref:`int<class_int>` | :ref:`inner_item_margin_right<class_Tree_theme_constant_inner_item_margin_right>` | ``0`` |
  214. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  215. | :ref:`int<class_int>` | :ref:`inner_item_margin_top<class_Tree_theme_constant_inner_item_margin_top>` | ``0`` |
  216. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  217. | :ref:`int<class_int>` | :ref:`item_margin<class_Tree_theme_constant_item_margin>` | ``16`` |
  218. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  219. | :ref:`int<class_int>` | :ref:`outline_size<class_Tree_theme_constant_outline_size>` | ``0`` |
  220. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  221. | :ref:`int<class_int>` | :ref:`parent_hl_line_margin<class_Tree_theme_constant_parent_hl_line_margin>` | ``0`` |
  222. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  223. | :ref:`int<class_int>` | :ref:`parent_hl_line_width<class_Tree_theme_constant_parent_hl_line_width>` | ``1`` |
  224. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  225. | :ref:`int<class_int>` | :ref:`relationship_line_width<class_Tree_theme_constant_relationship_line_width>` | ``1`` |
  226. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  227. | :ref:`int<class_int>` | :ref:`scroll_border<class_Tree_theme_constant_scroll_border>` | ``4`` |
  228. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  229. | :ref:`int<class_int>` | :ref:`scroll_speed<class_Tree_theme_constant_scroll_speed>` | ``12`` |
  230. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  231. | :ref:`int<class_int>` | :ref:`scrollbar_h_separation<class_Tree_theme_constant_scrollbar_h_separation>` | ``4`` |
  232. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  233. | :ref:`int<class_int>` | :ref:`scrollbar_margin_bottom<class_Tree_theme_constant_scrollbar_margin_bottom>` | ``-1`` |
  234. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  235. | :ref:`int<class_int>` | :ref:`scrollbar_margin_left<class_Tree_theme_constant_scrollbar_margin_left>` | ``-1`` |
  236. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  237. | :ref:`int<class_int>` | :ref:`scrollbar_margin_right<class_Tree_theme_constant_scrollbar_margin_right>` | ``-1`` |
  238. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  239. | :ref:`int<class_int>` | :ref:`scrollbar_margin_top<class_Tree_theme_constant_scrollbar_margin_top>` | ``-1`` |
  240. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  241. | :ref:`int<class_int>` | :ref:`scrollbar_v_separation<class_Tree_theme_constant_scrollbar_v_separation>` | ``4`` |
  242. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  243. | :ref:`int<class_int>` | :ref:`v_separation<class_Tree_theme_constant_v_separation>` | ``4`` |
  244. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  245. | :ref:`Font<class_Font>` | :ref:`font<class_Tree_theme_font_font>` | |
  246. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  247. | :ref:`Font<class_Font>` | :ref:`title_button_font<class_Tree_theme_font_title_button_font>` | |
  248. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  249. | :ref:`int<class_int>` | :ref:`font_size<class_Tree_theme_font_size_font_size>` | |
  250. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  251. | :ref:`int<class_int>` | :ref:`title_button_font_size<class_Tree_theme_font_size_title_button_font_size>` | |
  252. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  253. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow<class_Tree_theme_icon_arrow>` | |
  254. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  255. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow_collapsed<class_Tree_theme_icon_arrow_collapsed>` | |
  256. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  257. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow_collapsed_mirrored<class_Tree_theme_icon_arrow_collapsed_mirrored>` | |
  258. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  259. | :ref:`Texture2D<class_Texture2D>` | :ref:`checked<class_Tree_theme_icon_checked>` | |
  260. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  261. | :ref:`Texture2D<class_Texture2D>` | :ref:`checked_disabled<class_Tree_theme_icon_checked_disabled>` | |
  262. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  263. | :ref:`Texture2D<class_Texture2D>` | :ref:`indeterminate<class_Tree_theme_icon_indeterminate>` | |
  264. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  265. | :ref:`Texture2D<class_Texture2D>` | :ref:`indeterminate_disabled<class_Tree_theme_icon_indeterminate_disabled>` | |
  266. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  267. | :ref:`Texture2D<class_Texture2D>` | :ref:`select_arrow<class_Tree_theme_icon_select_arrow>` | |
  268. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  269. | :ref:`Texture2D<class_Texture2D>` | :ref:`unchecked<class_Tree_theme_icon_unchecked>` | |
  270. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  271. | :ref:`Texture2D<class_Texture2D>` | :ref:`unchecked_disabled<class_Tree_theme_icon_unchecked_disabled>` | |
  272. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  273. | :ref:`Texture2D<class_Texture2D>` | :ref:`updown<class_Tree_theme_icon_updown>` | |
  274. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  275. | :ref:`StyleBox<class_StyleBox>` | :ref:`button_hover<class_Tree_theme_style_button_hover>` | |
  276. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  277. | :ref:`StyleBox<class_StyleBox>` | :ref:`button_pressed<class_Tree_theme_style_button_pressed>` | |
  278. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  279. | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor<class_Tree_theme_style_cursor>` | |
  280. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  281. | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor_unfocused<class_Tree_theme_style_cursor_unfocused>` | |
  282. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  283. | :ref:`StyleBox<class_StyleBox>` | :ref:`custom_button<class_Tree_theme_style_custom_button>` | |
  284. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  285. | :ref:`StyleBox<class_StyleBox>` | :ref:`custom_button_hover<class_Tree_theme_style_custom_button_hover>` | |
  286. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  287. | :ref:`StyleBox<class_StyleBox>` | :ref:`custom_button_pressed<class_Tree_theme_style_custom_button_pressed>` | |
  288. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  289. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_Tree_theme_style_focus>` | |
  290. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  291. | :ref:`StyleBox<class_StyleBox>` | :ref:`hovered<class_Tree_theme_style_hovered>` | |
  292. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  293. | :ref:`StyleBox<class_StyleBox>` | :ref:`hovered_dimmed<class_Tree_theme_style_hovered_dimmed>` | |
  294. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  295. | :ref:`StyleBox<class_StyleBox>` | :ref:`hovered_selected<class_Tree_theme_style_hovered_selected>` | |
  296. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  297. | :ref:`StyleBox<class_StyleBox>` | :ref:`hovered_selected_focus<class_Tree_theme_style_hovered_selected_focus>` | |
  298. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  299. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_Tree_theme_style_panel>` | |
  300. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  301. | :ref:`StyleBox<class_StyleBox>` | :ref:`selected<class_Tree_theme_style_selected>` | |
  302. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  303. | :ref:`StyleBox<class_StyleBox>` | :ref:`selected_focus<class_Tree_theme_style_selected_focus>` | |
  304. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  305. | :ref:`StyleBox<class_StyleBox>` | :ref:`title_button_hover<class_Tree_theme_style_title_button_hover>` | |
  306. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  307. | :ref:`StyleBox<class_StyleBox>` | :ref:`title_button_normal<class_Tree_theme_style_title_button_normal>` | |
  308. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  309. | :ref:`StyleBox<class_StyleBox>` | :ref:`title_button_pressed<class_Tree_theme_style_title_button_pressed>` | |
  310. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  311. .. rst-class:: classref-section-separator
  312. ----
  313. .. rst-class:: classref-descriptions-group
  314. Signals
  315. -------
  316. .. _class_Tree_signal_button_clicked:
  317. .. rst-class:: classref-signal
  318. **button_clicked**\ (\ item\: :ref:`TreeItem<class_TreeItem>`, column\: :ref:`int<class_int>`, id\: :ref:`int<class_int>`, mouse_button_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_button_clicked>`
  319. Emitted when a button on the tree was pressed (see :ref:`TreeItem.add_button()<class_TreeItem_method_add_button>`).
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_Tree_signal_cell_selected:
  323. .. rst-class:: classref-signal
  324. **cell_selected**\ (\ ) :ref:`๐Ÿ”—<class_Tree_signal_cell_selected>`
  325. Emitted when a cell is selected.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_Tree_signal_check_propagated_to_item:
  329. .. rst-class:: classref-signal
  330. **check_propagated_to_item**\ (\ item\: :ref:`TreeItem<class_TreeItem>`, column\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_check_propagated_to_item>`
  331. 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.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_Tree_signal_column_title_clicked:
  335. .. rst-class:: classref-signal
  336. **column_title_clicked**\ (\ column\: :ref:`int<class_int>`, mouse_button_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_column_title_clicked>`
  337. 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>`.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_Tree_signal_custom_item_clicked:
  341. .. rst-class:: classref-signal
  342. **custom_item_clicked**\ (\ mouse_button_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_custom_item_clicked>`
  343. Emitted when an item with :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` is clicked with a mouse button.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_Tree_signal_custom_popup_edited:
  347. .. rst-class:: classref-signal
  348. **custom_popup_edited**\ (\ arrow_clicked\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_custom_popup_edited>`
  349. Emitted when a cell with the :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` is clicked to be edited.
  350. .. rst-class:: classref-item-separator
  351. ----
  352. .. _class_Tree_signal_empty_clicked:
  353. .. rst-class:: classref-signal
  354. **empty_clicked**\ (\ click_position\: :ref:`Vector2<class_Vector2>`, mouse_button_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_empty_clicked>`
  355. Emitted when a mouse button is clicked in the empty space of the tree.
  356. .. rst-class:: classref-item-separator
  357. ----
  358. .. _class_Tree_signal_item_activated:
  359. .. rst-class:: classref-signal
  360. **item_activated**\ (\ ) :ref:`๐Ÿ”—<class_Tree_signal_item_activated>`
  361. Emitted when an item is double-clicked, or selected with a ``ui_accept`` input event (e.g. using :kbd:`Enter` or :kbd:`Space` on the keyboard).
  362. .. rst-class:: classref-item-separator
  363. ----
  364. .. _class_Tree_signal_item_collapsed:
  365. .. rst-class:: classref-signal
  366. **item_collapsed**\ (\ item\: :ref:`TreeItem<class_TreeItem>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_item_collapsed>`
  367. Emitted when an item is expanded or collapsed by clicking on the folding arrow or through code.
  368. \ **Note:** Despite its name, this signal is also emitted when an item is expanded.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_Tree_signal_item_edited:
  372. .. rst-class:: classref-signal
  373. **item_edited**\ (\ ) :ref:`๐Ÿ”—<class_Tree_signal_item_edited>`
  374. Emitted when an item is edited.
  375. .. rst-class:: classref-item-separator
  376. ----
  377. .. _class_Tree_signal_item_icon_double_clicked:
  378. .. rst-class:: classref-signal
  379. **item_icon_double_clicked**\ (\ ) :ref:`๐Ÿ”—<class_Tree_signal_item_icon_double_clicked>`
  380. Emitted when an item's icon is double-clicked. For a signal that emits when any part of the item is double-clicked, see :ref:`item_activated<class_Tree_signal_item_activated>`.
  381. .. rst-class:: classref-item-separator
  382. ----
  383. .. _class_Tree_signal_item_mouse_selected:
  384. .. rst-class:: classref-signal
  385. **item_mouse_selected**\ (\ mouse_position\: :ref:`Vector2<class_Vector2>`, mouse_button_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_item_mouse_selected>`
  386. Emitted when an item is selected with a mouse button.
  387. .. rst-class:: classref-item-separator
  388. ----
  389. .. _class_Tree_signal_item_selected:
  390. .. rst-class:: classref-signal
  391. **item_selected**\ (\ ) :ref:`๐Ÿ”—<class_Tree_signal_item_selected>`
  392. Emitted when an item is selected.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_Tree_signal_multi_selected:
  396. .. rst-class:: classref-signal
  397. **multi_selected**\ (\ item\: :ref:`TreeItem<class_TreeItem>`, column\: :ref:`int<class_int>`, selected\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_Tree_signal_multi_selected>`
  398. Emitted instead of :ref:`item_selected<class_Tree_signal_item_selected>` if :ref:`select_mode<class_Tree_property_select_mode>` is set to :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>`.
  399. .. rst-class:: classref-item-separator
  400. ----
  401. .. _class_Tree_signal_nothing_selected:
  402. .. rst-class:: classref-signal
  403. **nothing_selected**\ (\ ) :ref:`๐Ÿ”—<class_Tree_signal_nothing_selected>`
  404. Emitted when a left mouse button click does not select any item.
  405. .. rst-class:: classref-section-separator
  406. ----
  407. .. rst-class:: classref-descriptions-group
  408. Enumerations
  409. ------------
  410. .. _enum_Tree_SelectMode:
  411. .. rst-class:: classref-enumeration
  412. enum **SelectMode**: :ref:`๐Ÿ”—<enum_Tree_SelectMode>`
  413. .. _class_Tree_constant_SELECT_SINGLE:
  414. .. rst-class:: classref-enumeration-constant
  415. :ref:`SelectMode<enum_Tree_SelectMode>` **SELECT_SINGLE** = ``0``
  416. 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.
  417. 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.
  418. .. _class_Tree_constant_SELECT_ROW:
  419. .. rst-class:: classref-enumeration-constant
  420. :ref:`SelectMode<enum_Tree_SelectMode>` **SELECT_ROW** = ``1``
  421. 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.
  422. 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.
  423. .. _class_Tree_constant_SELECT_MULTI:
  424. .. rst-class:: classref-enumeration-constant
  425. :ref:`SelectMode<enum_Tree_SelectMode>` **SELECT_MULTI** = ``2``
  426. 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.
  427. The focus cursor is visible in this mode, the item or column under the cursor is not necessarily selected.
  428. .. rst-class:: classref-item-separator
  429. ----
  430. .. _enum_Tree_DropModeFlags:
  431. .. rst-class:: classref-enumeration
  432. enum **DropModeFlags**: :ref:`๐Ÿ”—<enum_Tree_DropModeFlags>`
  433. .. _class_Tree_constant_DROP_MODE_DISABLED:
  434. .. rst-class:: classref-enumeration-constant
  435. :ref:`DropModeFlags<enum_Tree_DropModeFlags>` **DROP_MODE_DISABLED** = ``0``
  436. 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>`.
  437. \ **Note:** This is the default flag, it has no effect when combined with other flags.
  438. .. _class_Tree_constant_DROP_MODE_ON_ITEM:
  439. .. rst-class:: classref-enumeration-constant
  440. :ref:`DropModeFlags<enum_Tree_DropModeFlags>` **DROP_MODE_ON_ITEM** = ``1``
  441. Enables the "on item" drop section. This drop section covers the entire item.
  442. When combined with :ref:`DROP_MODE_INBETWEEN<class_Tree_constant_DROP_MODE_INBETWEEN>`, this drop section halves the height and stays centered vertically.
  443. .. _class_Tree_constant_DROP_MODE_INBETWEEN:
  444. .. rst-class:: classref-enumeration-constant
  445. :ref:`DropModeFlags<enum_Tree_DropModeFlags>` **DROP_MODE_INBETWEEN** = ``2``
  446. 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.
  447. 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.
  448. .. rst-class:: classref-section-separator
  449. ----
  450. .. rst-class:: classref-descriptions-group
  451. Property Descriptions
  452. ---------------------
  453. .. _class_Tree_property_allow_reselect:
  454. .. rst-class:: classref-property
  455. :ref:`bool<class_bool>` **allow_reselect** = ``false`` :ref:`๐Ÿ”—<class_Tree_property_allow_reselect>`
  456. .. rst-class:: classref-property-setget
  457. - |void| **set_allow_reselect**\ (\ value\: :ref:`bool<class_bool>`\ )
  458. - :ref:`bool<class_bool>` **get_allow_reselect**\ (\ )
  459. If ``true``, the currently selected cell may be selected again.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_Tree_property_allow_rmb_select:
  463. .. rst-class:: classref-property
  464. :ref:`bool<class_bool>` **allow_rmb_select** = ``false`` :ref:`๐Ÿ”—<class_Tree_property_allow_rmb_select>`
  465. .. rst-class:: classref-property-setget
  466. - |void| **set_allow_rmb_select**\ (\ value\: :ref:`bool<class_bool>`\ )
  467. - :ref:`bool<class_bool>` **get_allow_rmb_select**\ (\ )
  468. If ``true``, a right mouse button click can select items.
  469. .. rst-class:: classref-item-separator
  470. ----
  471. .. _class_Tree_property_allow_search:
  472. .. rst-class:: classref-property
  473. :ref:`bool<class_bool>` **allow_search** = ``true`` :ref:`๐Ÿ”—<class_Tree_property_allow_search>`
  474. .. rst-class:: classref-property-setget
  475. - |void| **set_allow_search**\ (\ value\: :ref:`bool<class_bool>`\ )
  476. - :ref:`bool<class_bool>` **get_allow_search**\ (\ )
  477. If ``true``, allows navigating the **Tree** with letter keys through incremental search.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_Tree_property_auto_tooltip:
  481. .. rst-class:: classref-property
  482. :ref:`bool<class_bool>` **auto_tooltip** = ``true`` :ref:`๐Ÿ”—<class_Tree_property_auto_tooltip>`
  483. .. rst-class:: classref-property-setget
  484. - |void| **set_auto_tooltip**\ (\ value\: :ref:`bool<class_bool>`\ )
  485. - :ref:`bool<class_bool>` **is_auto_tooltip_enabled**\ (\ )
  486. If ``true``, tree items with no tooltip assigned display their text as their tooltip. See also :ref:`TreeItem.get_tooltip_text()<class_TreeItem_method_get_tooltip_text>` and :ref:`TreeItem.get_button_tooltip_text()<class_TreeItem_method_get_button_tooltip_text>`.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_Tree_property_column_titles_visible:
  490. .. rst-class:: classref-property
  491. :ref:`bool<class_bool>` **column_titles_visible** = ``false`` :ref:`๐Ÿ”—<class_Tree_property_column_titles_visible>`
  492. .. rst-class:: classref-property-setget
  493. - |void| **set_column_titles_visible**\ (\ value\: :ref:`bool<class_bool>`\ )
  494. - :ref:`bool<class_bool>` **are_column_titles_visible**\ (\ )
  495. If ``true``, column titles are visible.
  496. .. rst-class:: classref-item-separator
  497. ----
  498. .. _class_Tree_property_columns:
  499. .. rst-class:: classref-property
  500. :ref:`int<class_int>` **columns** = ``1`` :ref:`๐Ÿ”—<class_Tree_property_columns>`
  501. .. rst-class:: classref-property-setget
  502. - |void| **set_columns**\ (\ value\: :ref:`int<class_int>`\ )
  503. - :ref:`int<class_int>` **get_columns**\ (\ )
  504. The number of columns.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_Tree_property_drop_mode_flags:
  508. .. rst-class:: classref-property
  509. :ref:`int<class_int>` **drop_mode_flags** = ``0`` :ref:`๐Ÿ”—<class_Tree_property_drop_mode_flags>`
  510. .. rst-class:: classref-property-setget
  511. - |void| **set_drop_mode_flags**\ (\ value\: :ref:`int<class_int>`\ )
  512. - :ref:`int<class_int>` **get_drop_mode_flags**\ (\ )
  513. 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_private_method__can_drop_data>` is recommended.
  514. This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position.
  515. .. rst-class:: classref-item-separator
  516. ----
  517. .. _class_Tree_property_enable_drag_unfolding:
  518. .. rst-class:: classref-property
  519. :ref:`bool<class_bool>` **enable_drag_unfolding** = ``true`` :ref:`๐Ÿ”—<class_Tree_property_enable_drag_unfolding>`
  520. .. rst-class:: classref-property-setget
  521. - |void| **set_enable_drag_unfolding**\ (\ value\: :ref:`bool<class_bool>`\ )
  522. - :ref:`bool<class_bool>` **is_drag_unfolding_enabled**\ (\ )
  523. If ``true``, tree items will unfold when hovered over during a drag-and-drop. The delay for when this happens is dictated by :ref:`dragging_unfold_wait_msec<class_Tree_theme_constant_dragging_unfold_wait_msec>`.
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _class_Tree_property_enable_recursive_folding:
  527. .. rst-class:: classref-property
  528. :ref:`bool<class_bool>` **enable_recursive_folding** = ``true`` :ref:`๐Ÿ”—<class_Tree_property_enable_recursive_folding>`
  529. .. rst-class:: classref-property-setget
  530. - |void| **set_enable_recursive_folding**\ (\ value\: :ref:`bool<class_bool>`\ )
  531. - :ref:`bool<class_bool>` **is_recursive_folding_enabled**\ (\ )
  532. If ``true``, recursive folding is enabled for this **Tree**. Holding down :kbd:`Shift` while clicking the fold arrow or using ``ui_right``/``ui_left`` shortcuts collapses or uncollapses the :ref:`TreeItem<class_TreeItem>` and all its descendants.
  533. .. rst-class:: classref-item-separator
  534. ----
  535. .. _class_Tree_property_hide_folding:
  536. .. rst-class:: classref-property
  537. :ref:`bool<class_bool>` **hide_folding** = ``false`` :ref:`๐Ÿ”—<class_Tree_property_hide_folding>`
  538. .. rst-class:: classref-property-setget
  539. - |void| **set_hide_folding**\ (\ value\: :ref:`bool<class_bool>`\ )
  540. - :ref:`bool<class_bool>` **is_folding_hidden**\ (\ )
  541. If ``true``, the folding arrow is hidden.
  542. .. rst-class:: classref-item-separator
  543. ----
  544. .. _class_Tree_property_hide_root:
  545. .. rst-class:: classref-property
  546. :ref:`bool<class_bool>` **hide_root** = ``false`` :ref:`๐Ÿ”—<class_Tree_property_hide_root>`
  547. .. rst-class:: classref-property-setget
  548. - |void| **set_hide_root**\ (\ value\: :ref:`bool<class_bool>`\ )
  549. - :ref:`bool<class_bool>` **is_root_hidden**\ (\ )
  550. If ``true``, the tree's root is hidden.
  551. .. rst-class:: classref-item-separator
  552. ----
  553. .. _class_Tree_property_scroll_horizontal_enabled:
  554. .. rst-class:: classref-property
  555. :ref:`bool<class_bool>` **scroll_horizontal_enabled** = ``true`` :ref:`๐Ÿ”—<class_Tree_property_scroll_horizontal_enabled>`
  556. .. rst-class:: classref-property-setget
  557. - |void| **set_h_scroll_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  558. - :ref:`bool<class_bool>` **is_h_scroll_enabled**\ (\ )
  559. If ``true``, enables horizontal scrolling.
  560. .. rst-class:: classref-item-separator
  561. ----
  562. .. _class_Tree_property_scroll_vertical_enabled:
  563. .. rst-class:: classref-property
  564. :ref:`bool<class_bool>` **scroll_vertical_enabled** = ``true`` :ref:`๐Ÿ”—<class_Tree_property_scroll_vertical_enabled>`
  565. .. rst-class:: classref-property-setget
  566. - |void| **set_v_scroll_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  567. - :ref:`bool<class_bool>` **is_v_scroll_enabled**\ (\ )
  568. If ``true``, enables vertical scrolling.
  569. .. rst-class:: classref-item-separator
  570. ----
  571. .. _class_Tree_property_select_mode:
  572. .. rst-class:: classref-property
  573. :ref:`SelectMode<enum_Tree_SelectMode>` **select_mode** = ``0`` :ref:`๐Ÿ”—<class_Tree_property_select_mode>`
  574. .. rst-class:: classref-property-setget
  575. - |void| **set_select_mode**\ (\ value\: :ref:`SelectMode<enum_Tree_SelectMode>`\ )
  576. - :ref:`SelectMode<enum_Tree_SelectMode>` **get_select_mode**\ (\ )
  577. Allows single or multiple selection. See the :ref:`SelectMode<enum_Tree_SelectMode>` constants.
  578. .. rst-class:: classref-section-separator
  579. ----
  580. .. rst-class:: classref-descriptions-group
  581. Method Descriptions
  582. -------------------
  583. .. _class_Tree_method_clear:
  584. .. rst-class:: classref-method
  585. |void| **clear**\ (\ ) :ref:`๐Ÿ”—<class_Tree_method_clear>`
  586. Clears the tree. This removes all items.
  587. .. rst-class:: classref-item-separator
  588. ----
  589. .. _class_Tree_method_create_item:
  590. .. rst-class:: classref-method
  591. :ref:`TreeItem<class_TreeItem>` **create_item**\ (\ parent\: :ref:`TreeItem<class_TreeItem>` = null, index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_Tree_method_create_item>`
  592. 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``.
  593. 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.
  594. The new item will be the ``index``-th child of parent, or it will be the last child if there are not enough siblings.
  595. .. rst-class:: classref-item-separator
  596. ----
  597. .. _class_Tree_method_deselect_all:
  598. .. rst-class:: classref-method
  599. |void| **deselect_all**\ (\ ) :ref:`๐Ÿ”—<class_Tree_method_deselect_all>`
  600. Deselects all tree items (rows and columns). In :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode also removes selection cursor.
  601. .. rst-class:: classref-item-separator
  602. ----
  603. .. _class_Tree_method_edit_selected:
  604. .. rst-class:: classref-method
  605. :ref:`bool<class_bool>` **edit_selected**\ (\ force_edit\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_Tree_method_edit_selected>`
  606. Edits the selected tree item as if it was clicked.
  607. Either the item must be set editable with :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>` or ``force_edit`` must be ``true``.
  608. Returns ``true`` if the item could be edited. Fails if no item is selected.
  609. .. rst-class:: classref-item-separator
  610. ----
  611. .. _class_Tree_method_ensure_cursor_is_visible:
  612. .. rst-class:: classref-method
  613. |void| **ensure_cursor_is_visible**\ (\ ) :ref:`๐Ÿ”—<class_Tree_method_ensure_cursor_is_visible>`
  614. Makes the currently focused cell visible.
  615. 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.
  616. \ **Note:** Despite the name of this method, the focus cursor itself is only visible in :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode.
  617. .. rst-class:: classref-item-separator
  618. ----
  619. .. _class_Tree_method_get_button_id_at_position:
  620. .. rst-class:: classref-method
  621. :ref:`int<class_int>` **get_button_id_at_position**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_button_id_at_position>`
  622. Returns the button ID at ``position``, or -1 if no button is there.
  623. .. rst-class:: classref-item-separator
  624. ----
  625. .. _class_Tree_method_get_column_at_position:
  626. .. rst-class:: classref-method
  627. :ref:`int<class_int>` **get_column_at_position**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_at_position>`
  628. Returns the column index at ``position``, or -1 if no item is there.
  629. .. rst-class:: classref-item-separator
  630. ----
  631. .. _class_Tree_method_get_column_expand_ratio:
  632. .. rst-class:: classref-method
  633. :ref:`int<class_int>` **get_column_expand_ratio**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_expand_ratio>`
  634. Returns the expand ratio assigned to the column.
  635. .. rst-class:: classref-item-separator
  636. ----
  637. .. _class_Tree_method_get_column_title:
  638. .. rst-class:: classref-method
  639. :ref:`String<class_String>` **get_column_title**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_title>`
  640. Returns the column's title.
  641. .. rst-class:: classref-item-separator
  642. ----
  643. .. _class_Tree_method_get_column_title_alignment:
  644. .. rst-class:: classref-method
  645. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_column_title_alignment**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_title_alignment>`
  646. Returns the column title alignment.
  647. .. rst-class:: classref-item-separator
  648. ----
  649. .. _class_Tree_method_get_column_title_direction:
  650. .. rst-class:: classref-method
  651. :ref:`TextDirection<enum_Control_TextDirection>` **get_column_title_direction**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_title_direction>`
  652. Returns column title base writing direction.
  653. .. rst-class:: classref-item-separator
  654. ----
  655. .. _class_Tree_method_get_column_title_language:
  656. .. rst-class:: classref-method
  657. :ref:`String<class_String>` **get_column_title_language**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_title_language>`
  658. Returns column title language code.
  659. .. rst-class:: classref-item-separator
  660. ----
  661. .. _class_Tree_method_get_column_title_tooltip_text:
  662. .. rst-class:: classref-method
  663. :ref:`String<class_String>` **get_column_title_tooltip_text**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_title_tooltip_text>`
  664. Returns the column title's tooltip text.
  665. .. rst-class:: classref-item-separator
  666. ----
  667. .. _class_Tree_method_get_column_width:
  668. .. rst-class:: classref-method
  669. :ref:`int<class_int>` **get_column_width**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_column_width>`
  670. Returns the column's width in pixels.
  671. .. rst-class:: classref-item-separator
  672. ----
  673. .. _class_Tree_method_get_custom_popup_rect:
  674. .. rst-class:: classref-method
  675. :ref:`Rect2<class_Rect2>` **get_custom_popup_rect**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_custom_popup_rect>`
  676. 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>`.
  677. .. rst-class:: classref-item-separator
  678. ----
  679. .. _class_Tree_method_get_drop_section_at_position:
  680. .. rst-class:: classref-method
  681. :ref:`int<class_int>` **get_drop_section_at_position**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_drop_section_at_position>`
  682. Returns the drop section at ``position``, or -100 if no item is there.
  683. 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.
  684. 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>`.
  685. .. rst-class:: classref-item-separator
  686. ----
  687. .. _class_Tree_method_get_edited:
  688. .. rst-class:: classref-method
  689. :ref:`TreeItem<class_TreeItem>` **get_edited**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_edited>`
  690. Returns the currently edited item. Can be used with :ref:`item_edited<class_Tree_signal_item_edited>` to get the item that was modified.
  691. .. tabs::
  692. .. code-tab:: gdscript
  693. func _ready():
  694. $Tree.item_edited.connect(on_Tree_item_edited)
  695. func on_Tree_item_edited():
  696. print($Tree.get_edited()) # This item just got edited (e.g. checked).
  697. .. code-tab:: csharp
  698. public override void _Ready()
  699. {
  700. GetNode<Tree>("Tree").ItemEdited += OnTreeItemEdited;
  701. }
  702. public void OnTreeItemEdited()
  703. {
  704. GD.Print(GetNode<Tree>("Tree").GetEdited()); // This item just got edited (e.g. checked).
  705. }
  706. .. rst-class:: classref-item-separator
  707. ----
  708. .. _class_Tree_method_get_edited_column:
  709. .. rst-class:: classref-method
  710. :ref:`int<class_int>` **get_edited_column**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_edited_column>`
  711. Returns the column for the currently edited item.
  712. .. rst-class:: classref-item-separator
  713. ----
  714. .. _class_Tree_method_get_item_area_rect:
  715. .. rst-class:: classref-method
  716. :ref:`Rect2<class_Rect2>` **get_item_area_rect**\ (\ item\: :ref:`TreeItem<class_TreeItem>`, column\: :ref:`int<class_int>` = -1, button_index\: :ref:`int<class_int>` = -1\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_item_area_rect>`
  717. 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.
  718. .. rst-class:: classref-item-separator
  719. ----
  720. .. _class_Tree_method_get_item_at_position:
  721. .. rst-class:: classref-method
  722. :ref:`TreeItem<class_TreeItem>` **get_item_at_position**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_item_at_position>`
  723. Returns the tree item at the specified position (relative to the tree origin position).
  724. .. rst-class:: classref-item-separator
  725. ----
  726. .. _class_Tree_method_get_next_selected:
  727. .. rst-class:: classref-method
  728. :ref:`TreeItem<class_TreeItem>` **get_next_selected**\ (\ from\: :ref:`TreeItem<class_TreeItem>`\ ) :ref:`๐Ÿ”—<class_Tree_method_get_next_selected>`
  729. Returns the next selected :ref:`TreeItem<class_TreeItem>` after the given one, or ``null`` if the end is reached.
  730. If ``from`` is ``null``, this returns the first selected item.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_Tree_method_get_pressed_button:
  734. .. rst-class:: classref-method
  735. :ref:`int<class_int>` **get_pressed_button**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_pressed_button>`
  736. Returns the last pressed button's index.
  737. .. rst-class:: classref-item-separator
  738. ----
  739. .. _class_Tree_method_get_root:
  740. .. rst-class:: classref-method
  741. :ref:`TreeItem<class_TreeItem>` **get_root**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_root>`
  742. Returns the tree's root item, or ``null`` if the tree is empty.
  743. .. rst-class:: classref-item-separator
  744. ----
  745. .. _class_Tree_method_get_scroll:
  746. .. rst-class:: classref-method
  747. :ref:`Vector2<class_Vector2>` **get_scroll**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_scroll>`
  748. Returns the current scrolling position.
  749. .. rst-class:: classref-item-separator
  750. ----
  751. .. _class_Tree_method_get_selected:
  752. .. rst-class:: classref-method
  753. :ref:`TreeItem<class_TreeItem>` **get_selected**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_selected>`
  754. Returns the currently focused item, or ``null`` if no item is focused.
  755. 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.
  756. To get the currently selected item(s), use :ref:`get_next_selected()<class_Tree_method_get_next_selected>`.
  757. .. rst-class:: classref-item-separator
  758. ----
  759. .. _class_Tree_method_get_selected_column:
  760. .. rst-class:: classref-method
  761. :ref:`int<class_int>` **get_selected_column**\ (\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_get_selected_column>`
  762. Returns the currently focused column, or -1 if no column is focused.
  763. 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.
  764. To tell whether a column of an item is selected, use :ref:`TreeItem.is_selected()<class_TreeItem_method_is_selected>`.
  765. .. rst-class:: classref-item-separator
  766. ----
  767. .. _class_Tree_method_is_column_clipping_content:
  768. .. rst-class:: classref-method
  769. :ref:`bool<class_bool>` **is_column_clipping_content**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_is_column_clipping_content>`
  770. Returns ``true`` if the column has enabled clipping (see :ref:`set_column_clip_content()<class_Tree_method_set_column_clip_content>`).
  771. .. rst-class:: classref-item-separator
  772. ----
  773. .. _class_Tree_method_is_column_expanding:
  774. .. rst-class:: classref-method
  775. :ref:`bool<class_bool>` **is_column_expanding**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_Tree_method_is_column_expanding>`
  776. Returns ``true`` if the column has enabled expanding (see :ref:`set_column_expand()<class_Tree_method_set_column_expand>`).
  777. .. rst-class:: classref-item-separator
  778. ----
  779. .. _class_Tree_method_scroll_to_item:
  780. .. rst-class:: classref-method
  781. |void| **scroll_to_item**\ (\ item\: :ref:`TreeItem<class_TreeItem>`, center_on_item\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_Tree_method_scroll_to_item>`
  782. Causes the **Tree** to jump to the specified :ref:`TreeItem<class_TreeItem>`.
  783. .. rst-class:: classref-item-separator
  784. ----
  785. .. _class_Tree_method_set_column_clip_content:
  786. .. rst-class:: classref-method
  787. |void| **set_column_clip_content**\ (\ column\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_clip_content>`
  788. Allows to enable clipping for column's content, making the content size ignored.
  789. .. rst-class:: classref-item-separator
  790. ----
  791. .. _class_Tree_method_set_column_custom_minimum_width:
  792. .. rst-class:: classref-method
  793. |void| **set_column_custom_minimum_width**\ (\ column\: :ref:`int<class_int>`, min_width\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_custom_minimum_width>`
  794. 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>`.
  795. .. rst-class:: classref-item-separator
  796. ----
  797. .. _class_Tree_method_set_column_expand:
  798. .. rst-class:: classref-method
  799. |void| **set_column_expand**\ (\ column\: :ref:`int<class_int>`, expand\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_expand>`
  800. 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>`).
  801. .. rst-class:: classref-item-separator
  802. ----
  803. .. _class_Tree_method_set_column_expand_ratio:
  804. .. rst-class:: classref-method
  805. |void| **set_column_expand_ratio**\ (\ column\: :ref:`int<class_int>`, ratio\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_expand_ratio>`
  806. Sets the relative expand ratio for a column. See :ref:`set_column_expand()<class_Tree_method_set_column_expand>`.
  807. .. rst-class:: classref-item-separator
  808. ----
  809. .. _class_Tree_method_set_column_title:
  810. .. rst-class:: classref-method
  811. |void| **set_column_title**\ (\ column\: :ref:`int<class_int>`, title\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_title>`
  812. Sets the title of a column.
  813. .. rst-class:: classref-item-separator
  814. ----
  815. .. _class_Tree_method_set_column_title_alignment:
  816. .. rst-class:: classref-method
  817. |void| **set_column_title_alignment**\ (\ column\: :ref:`int<class_int>`, title_alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_title_alignment>`
  818. Sets the column title alignment. Note that :ref:`@GlobalScope.HORIZONTAL_ALIGNMENT_FILL<class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_FILL>` is not supported for column titles.
  819. .. rst-class:: classref-item-separator
  820. ----
  821. .. _class_Tree_method_set_column_title_direction:
  822. .. rst-class:: classref-method
  823. |void| **set_column_title_direction**\ (\ column\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_title_direction>`
  824. Sets column title base writing direction.
  825. .. rst-class:: classref-item-separator
  826. ----
  827. .. _class_Tree_method_set_column_title_language:
  828. .. rst-class:: classref-method
  829. |void| **set_column_title_language**\ (\ column\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_title_language>`
  830. Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  831. .. rst-class:: classref-item-separator
  832. ----
  833. .. _class_Tree_method_set_column_title_tooltip_text:
  834. .. rst-class:: classref-method
  835. |void| **set_column_title_tooltip_text**\ (\ column\: :ref:`int<class_int>`, tooltip_text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_column_title_tooltip_text>`
  836. Sets the column title's tooltip text.
  837. .. rst-class:: classref-item-separator
  838. ----
  839. .. _class_Tree_method_set_selected:
  840. .. rst-class:: classref-method
  841. |void| **set_selected**\ (\ item\: :ref:`TreeItem<class_TreeItem>`, column\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Tree_method_set_selected>`
  842. Selects the specified :ref:`TreeItem<class_TreeItem>` and column.
  843. .. rst-class:: classref-section-separator
  844. ----
  845. .. rst-class:: classref-descriptions-group
  846. Theme Property Descriptions
  847. ---------------------------
  848. .. _class_Tree_theme_color_children_hl_line_color:
  849. .. rst-class:: classref-themeproperty
  850. :ref:`Color<class_Color>` **children_hl_line_color** = ``Color(0.27, 0.27, 0.27, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_children_hl_line_color>`
  851. The :ref:`Color<class_Color>` of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its children.
  852. .. rst-class:: classref-item-separator
  853. ----
  854. .. _class_Tree_theme_color_custom_button_font_highlight:
  855. .. rst-class:: classref-themeproperty
  856. :ref:`Color<class_Color>` **custom_button_font_highlight** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_custom_button_font_highlight>`
  857. Text :ref:`Color<class_Color>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell when it's hovered.
  858. .. rst-class:: classref-item-separator
  859. ----
  860. .. _class_Tree_theme_color_drop_position_color:
  861. .. rst-class:: classref-themeproperty
  862. :ref:`Color<class_Color>` **drop_position_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_drop_position_color>`
  863. :ref:`Color<class_Color>` used to draw possible drop locations. See :ref:`DropModeFlags<enum_Tree_DropModeFlags>` constants for further description of drop locations.
  864. .. rst-class:: classref-item-separator
  865. ----
  866. .. _class_Tree_theme_color_font_color:
  867. .. rst-class:: classref-themeproperty
  868. :ref:`Color<class_Color>` **font_color** = ``Color(0.7, 0.7, 0.7, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_font_color>`
  869. Default text :ref:`Color<class_Color>` of the item.
  870. .. rst-class:: classref-item-separator
  871. ----
  872. .. _class_Tree_theme_color_font_disabled_color:
  873. .. rst-class:: classref-themeproperty
  874. :ref:`Color<class_Color>` **font_disabled_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`๐Ÿ”—<class_Tree_theme_color_font_disabled_color>`
  875. Text :ref:`Color<class_Color>` for a :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell when it's non-editable (see :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>`).
  876. .. rst-class:: classref-item-separator
  877. ----
  878. .. _class_Tree_theme_color_font_hovered_color:
  879. .. rst-class:: classref-themeproperty
  880. :ref:`Color<class_Color>` **font_hovered_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_font_hovered_color>`
  881. Text :ref:`Color<class_Color>` used when the item is hovered and not selected yet.
  882. .. rst-class:: classref-item-separator
  883. ----
  884. .. _class_Tree_theme_color_font_hovered_dimmed_color:
  885. .. rst-class:: classref-themeproperty
  886. :ref:`Color<class_Color>` **font_hovered_dimmed_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_font_hovered_dimmed_color>`
  887. Text :ref:`Color<class_Color>` used when the item is hovered, while a button of the same item is hovered as the same time.
  888. .. rst-class:: classref-item-separator
  889. ----
  890. .. _class_Tree_theme_color_font_hovered_selected_color:
  891. .. rst-class:: classref-themeproperty
  892. :ref:`Color<class_Color>` **font_hovered_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_font_hovered_selected_color>`
  893. Text :ref:`Color<class_Color>` used when the item is hovered and selected.
  894. .. rst-class:: classref-item-separator
  895. ----
  896. .. _class_Tree_theme_color_font_outline_color:
  897. .. rst-class:: classref-themeproperty
  898. :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_font_outline_color>`
  899. The tint of text outline of the item.
  900. .. rst-class:: classref-item-separator
  901. ----
  902. .. _class_Tree_theme_color_font_selected_color:
  903. .. rst-class:: classref-themeproperty
  904. :ref:`Color<class_Color>` **font_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_font_selected_color>`
  905. Text :ref:`Color<class_Color>` used when the item is selected.
  906. .. rst-class:: classref-item-separator
  907. ----
  908. .. _class_Tree_theme_color_guide_color:
  909. .. rst-class:: classref-themeproperty
  910. :ref:`Color<class_Color>` **guide_color** = ``Color(0.7, 0.7, 0.7, 0.25)`` :ref:`๐Ÿ”—<class_Tree_theme_color_guide_color>`
  911. :ref:`Color<class_Color>` of the guideline.
  912. .. rst-class:: classref-item-separator
  913. ----
  914. .. _class_Tree_theme_color_parent_hl_line_color:
  915. .. rst-class:: classref-themeproperty
  916. :ref:`Color<class_Color>` **parent_hl_line_color** = ``Color(0.27, 0.27, 0.27, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_parent_hl_line_color>`
  917. The :ref:`Color<class_Color>` of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its parents.
  918. .. rst-class:: classref-item-separator
  919. ----
  920. .. _class_Tree_theme_color_relationship_line_color:
  921. .. rst-class:: classref-themeproperty
  922. :ref:`Color<class_Color>` **relationship_line_color** = ``Color(0.27, 0.27, 0.27, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_relationship_line_color>`
  923. The default :ref:`Color<class_Color>` of the relationship lines.
  924. .. rst-class:: classref-item-separator
  925. ----
  926. .. _class_Tree_theme_color_title_button_color:
  927. .. rst-class:: classref-themeproperty
  928. :ref:`Color<class_Color>` **title_button_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`๐Ÿ”—<class_Tree_theme_color_title_button_color>`
  929. Default text :ref:`Color<class_Color>` of the title button.
  930. .. rst-class:: classref-item-separator
  931. ----
  932. .. _class_Tree_theme_constant_button_margin:
  933. .. rst-class:: classref-themeproperty
  934. :ref:`int<class_int>` **button_margin** = ``4`` :ref:`๐Ÿ”—<class_Tree_theme_constant_button_margin>`
  935. The horizontal space between each button in a cell.
  936. .. rst-class:: classref-item-separator
  937. ----
  938. .. _class_Tree_theme_constant_children_hl_line_width:
  939. .. rst-class:: classref-themeproperty
  940. :ref:`int<class_int>` **children_hl_line_width** = ``1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_children_hl_line_width>`
  941. The width of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its children.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_Tree_theme_constant_dragging_unfold_wait_msec:
  945. .. rst-class:: classref-themeproperty
  946. :ref:`int<class_int>` **dragging_unfold_wait_msec** = ``500`` :ref:`๐Ÿ”—<class_Tree_theme_constant_dragging_unfold_wait_msec>`
  947. During a drag-and-drop, this is how many milliseconds to wait over a section before the section unfolds.
  948. .. rst-class:: classref-item-separator
  949. ----
  950. .. _class_Tree_theme_constant_draw_guides:
  951. .. rst-class:: classref-themeproperty
  952. :ref:`int<class_int>` **draw_guides** = ``1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_draw_guides>`
  953. Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item.
  954. .. rst-class:: classref-item-separator
  955. ----
  956. .. _class_Tree_theme_constant_draw_relationship_lines:
  957. .. rst-class:: classref-themeproperty
  958. :ref:`int<class_int>` **draw_relationship_lines** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_draw_relationship_lines>`
  959. 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.
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_Tree_theme_constant_h_separation:
  963. .. rst-class:: classref-themeproperty
  964. :ref:`int<class_int>` **h_separation** = ``4`` :ref:`๐Ÿ”—<class_Tree_theme_constant_h_separation>`
  965. The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled.
  966. .. rst-class:: classref-item-separator
  967. ----
  968. .. _class_Tree_theme_constant_icon_max_width:
  969. .. rst-class:: classref-themeproperty
  970. :ref:`int<class_int>` **icon_max_width** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_icon_max_width>`
  971. The maximum allowed width of the icon in item's cells. This limit is applied on top of the default size of the icon, but before the value set with :ref:`TreeItem.set_icon_max_width()<class_TreeItem_method_set_icon_max_width>`. The height is adjusted according to the icon's ratio.
  972. .. rst-class:: classref-item-separator
  973. ----
  974. .. _class_Tree_theme_constant_inner_item_margin_bottom:
  975. .. rst-class:: classref-themeproperty
  976. :ref:`int<class_int>` **inner_item_margin_bottom** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_inner_item_margin_bottom>`
  977. The inner bottom margin of a cell.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_Tree_theme_constant_inner_item_margin_left:
  981. .. rst-class:: classref-themeproperty
  982. :ref:`int<class_int>` **inner_item_margin_left** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_inner_item_margin_left>`
  983. The inner left margin of a cell.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_Tree_theme_constant_inner_item_margin_right:
  987. .. rst-class:: classref-themeproperty
  988. :ref:`int<class_int>` **inner_item_margin_right** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_inner_item_margin_right>`
  989. The inner right margin of a cell.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_Tree_theme_constant_inner_item_margin_top:
  993. .. rst-class:: classref-themeproperty
  994. :ref:`int<class_int>` **inner_item_margin_top** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_inner_item_margin_top>`
  995. The inner top margin of a cell.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_Tree_theme_constant_item_margin:
  999. .. rst-class:: classref-themeproperty
  1000. :ref:`int<class_int>` **item_margin** = ``16`` :ref:`๐Ÿ”—<class_Tree_theme_constant_item_margin>`
  1001. The horizontal margin at the start of an item. This is used when folding is enabled for the item.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_Tree_theme_constant_outline_size:
  1005. .. rst-class:: classref-themeproperty
  1006. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_outline_size>`
  1007. The size of the text outline.
  1008. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_Tree_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  1009. .. rst-class:: classref-item-separator
  1010. ----
  1011. .. _class_Tree_theme_constant_parent_hl_line_margin:
  1012. .. rst-class:: classref-themeproperty
  1013. :ref:`int<class_int>` **parent_hl_line_margin** = ``0`` :ref:`๐Ÿ”—<class_Tree_theme_constant_parent_hl_line_margin>`
  1014. 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.
  1015. .. rst-class:: classref-item-separator
  1016. ----
  1017. .. _class_Tree_theme_constant_parent_hl_line_width:
  1018. .. rst-class:: classref-themeproperty
  1019. :ref:`int<class_int>` **parent_hl_line_width** = ``1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_parent_hl_line_width>`
  1020. The width of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its parents.
  1021. .. rst-class:: classref-item-separator
  1022. ----
  1023. .. _class_Tree_theme_constant_relationship_line_width:
  1024. .. rst-class:: classref-themeproperty
  1025. :ref:`int<class_int>` **relationship_line_width** = ``1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_relationship_line_width>`
  1026. The default width of the relationship lines.
  1027. .. rst-class:: classref-item-separator
  1028. ----
  1029. .. _class_Tree_theme_constant_scroll_border:
  1030. .. rst-class:: classref-themeproperty
  1031. :ref:`int<class_int>` **scroll_border** = ``4`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scroll_border>`
  1032. The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging.
  1033. .. rst-class:: classref-item-separator
  1034. ----
  1035. .. _class_Tree_theme_constant_scroll_speed:
  1036. .. rst-class:: classref-themeproperty
  1037. :ref:`int<class_int>` **scroll_speed** = ``12`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scroll_speed>`
  1038. The speed of border scrolling.
  1039. .. rst-class:: classref-item-separator
  1040. ----
  1041. .. _class_Tree_theme_constant_scrollbar_h_separation:
  1042. .. rst-class:: classref-themeproperty
  1043. :ref:`int<class_int>` **scrollbar_h_separation** = ``4`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scrollbar_h_separation>`
  1044. The horizontal separation of tree content and scrollbar.
  1045. .. rst-class:: classref-item-separator
  1046. ----
  1047. .. _class_Tree_theme_constant_scrollbar_margin_bottom:
  1048. .. rst-class:: classref-themeproperty
  1049. :ref:`int<class_int>` **scrollbar_margin_bottom** = ``-1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scrollbar_margin_bottom>`
  1050. The bottom margin of the scrollbars. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` bottom margin.
  1051. .. rst-class:: classref-item-separator
  1052. ----
  1053. .. _class_Tree_theme_constant_scrollbar_margin_left:
  1054. .. rst-class:: classref-themeproperty
  1055. :ref:`int<class_int>` **scrollbar_margin_left** = ``-1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scrollbar_margin_left>`
  1056. The left margin of the horizontal scrollbar. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` left margin.
  1057. .. rst-class:: classref-item-separator
  1058. ----
  1059. .. _class_Tree_theme_constant_scrollbar_margin_right:
  1060. .. rst-class:: classref-themeproperty
  1061. :ref:`int<class_int>` **scrollbar_margin_right** = ``-1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scrollbar_margin_right>`
  1062. The right margin of the scrollbars. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` right margin.
  1063. .. rst-class:: classref-item-separator
  1064. ----
  1065. .. _class_Tree_theme_constant_scrollbar_margin_top:
  1066. .. rst-class:: classref-themeproperty
  1067. :ref:`int<class_int>` **scrollbar_margin_top** = ``-1`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scrollbar_margin_top>`
  1068. The top margin of the vertical scrollbar. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` top margin.
  1069. .. rst-class:: classref-item-separator
  1070. ----
  1071. .. _class_Tree_theme_constant_scrollbar_v_separation:
  1072. .. rst-class:: classref-themeproperty
  1073. :ref:`int<class_int>` **scrollbar_v_separation** = ``4`` :ref:`๐Ÿ”—<class_Tree_theme_constant_scrollbar_v_separation>`
  1074. The vertical separation of tree content and scrollbar.
  1075. .. rst-class:: classref-item-separator
  1076. ----
  1077. .. _class_Tree_theme_constant_v_separation:
  1078. .. rst-class:: classref-themeproperty
  1079. :ref:`int<class_int>` **v_separation** = ``4`` :ref:`๐Ÿ”—<class_Tree_theme_constant_v_separation>`
  1080. The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border.
  1081. .. rst-class:: classref-item-separator
  1082. ----
  1083. .. _class_Tree_theme_font_font:
  1084. .. rst-class:: classref-themeproperty
  1085. :ref:`Font<class_Font>` **font** :ref:`๐Ÿ”—<class_Tree_theme_font_font>`
  1086. :ref:`Font<class_Font>` of the item's text.
  1087. .. rst-class:: classref-item-separator
  1088. ----
  1089. .. _class_Tree_theme_font_title_button_font:
  1090. .. rst-class:: classref-themeproperty
  1091. :ref:`Font<class_Font>` **title_button_font** :ref:`๐Ÿ”—<class_Tree_theme_font_title_button_font>`
  1092. :ref:`Font<class_Font>` of the title button's text.
  1093. .. rst-class:: classref-item-separator
  1094. ----
  1095. .. _class_Tree_theme_font_size_font_size:
  1096. .. rst-class:: classref-themeproperty
  1097. :ref:`int<class_int>` **font_size** :ref:`๐Ÿ”—<class_Tree_theme_font_size_font_size>`
  1098. Font size of the item's text.
  1099. .. rst-class:: classref-item-separator
  1100. ----
  1101. .. _class_Tree_theme_font_size_title_button_font_size:
  1102. .. rst-class:: classref-themeproperty
  1103. :ref:`int<class_int>` **title_button_font_size** :ref:`๐Ÿ”—<class_Tree_theme_font_size_title_button_font_size>`
  1104. Font size of the title button's text.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_Tree_theme_icon_arrow:
  1108. .. rst-class:: classref-themeproperty
  1109. :ref:`Texture2D<class_Texture2D>` **arrow** :ref:`๐Ÿ”—<class_Tree_theme_icon_arrow>`
  1110. The arrow icon used when a foldable item is not collapsed.
  1111. .. rst-class:: classref-item-separator
  1112. ----
  1113. .. _class_Tree_theme_icon_arrow_collapsed:
  1114. .. rst-class:: classref-themeproperty
  1115. :ref:`Texture2D<class_Texture2D>` **arrow_collapsed** :ref:`๐Ÿ”—<class_Tree_theme_icon_arrow_collapsed>`
  1116. The arrow icon used when a foldable item is collapsed (for left-to-right layouts).
  1117. .. rst-class:: classref-item-separator
  1118. ----
  1119. .. _class_Tree_theme_icon_arrow_collapsed_mirrored:
  1120. .. rst-class:: classref-themeproperty
  1121. :ref:`Texture2D<class_Texture2D>` **arrow_collapsed_mirrored** :ref:`๐Ÿ”—<class_Tree_theme_icon_arrow_collapsed_mirrored>`
  1122. The arrow icon used when a foldable item is collapsed (for right-to-left layouts).
  1123. .. rst-class:: classref-item-separator
  1124. ----
  1125. .. _class_Tree_theme_icon_checked:
  1126. .. rst-class:: classref-themeproperty
  1127. :ref:`Texture2D<class_Texture2D>` **checked** :ref:`๐Ÿ”—<class_Tree_theme_icon_checked>`
  1128. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is checked and editable (see :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>`).
  1129. .. rst-class:: classref-item-separator
  1130. ----
  1131. .. _class_Tree_theme_icon_checked_disabled:
  1132. .. rst-class:: classref-themeproperty
  1133. :ref:`Texture2D<class_Texture2D>` **checked_disabled** :ref:`๐Ÿ”—<class_Tree_theme_icon_checked_disabled>`
  1134. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is checked and non-editable (see :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>`).
  1135. .. rst-class:: classref-item-separator
  1136. ----
  1137. .. _class_Tree_theme_icon_indeterminate:
  1138. .. rst-class:: classref-themeproperty
  1139. :ref:`Texture2D<class_Texture2D>` **indeterminate** :ref:`๐Ÿ”—<class_Tree_theme_icon_indeterminate>`
  1140. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is indeterminate and editable (see :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>`).
  1141. .. rst-class:: classref-item-separator
  1142. ----
  1143. .. _class_Tree_theme_icon_indeterminate_disabled:
  1144. .. rst-class:: classref-themeproperty
  1145. :ref:`Texture2D<class_Texture2D>` **indeterminate_disabled** :ref:`๐Ÿ”—<class_Tree_theme_icon_indeterminate_disabled>`
  1146. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is indeterminate and non-editable (see :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>`).
  1147. .. rst-class:: classref-item-separator
  1148. ----
  1149. .. _class_Tree_theme_icon_select_arrow:
  1150. .. rst-class:: classref-themeproperty
  1151. :ref:`Texture2D<class_Texture2D>` **select_arrow** :ref:`๐Ÿ”—<class_Tree_theme_icon_select_arrow>`
  1152. The arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode cell.
  1153. .. rst-class:: classref-item-separator
  1154. ----
  1155. .. _class_Tree_theme_icon_unchecked:
  1156. .. rst-class:: classref-themeproperty
  1157. :ref:`Texture2D<class_Texture2D>` **unchecked** :ref:`๐Ÿ”—<class_Tree_theme_icon_unchecked>`
  1158. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is unchecked and editable (see :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>`).
  1159. .. rst-class:: classref-item-separator
  1160. ----
  1161. .. _class_Tree_theme_icon_unchecked_disabled:
  1162. .. rst-class:: classref-themeproperty
  1163. :ref:`Texture2D<class_Texture2D>` **unchecked_disabled** :ref:`๐Ÿ”—<class_Tree_theme_icon_unchecked_disabled>`
  1164. The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is unchecked and non-editable (see :ref:`TreeItem.set_editable()<class_TreeItem_method_set_editable>`).
  1165. .. rst-class:: classref-item-separator
  1166. ----
  1167. .. _class_Tree_theme_icon_updown:
  1168. .. rst-class:: classref-themeproperty
  1169. :ref:`Texture2D<class_Texture2D>` **updown** :ref:`๐Ÿ”—<class_Tree_theme_icon_updown>`
  1170. The updown arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode cell.
  1171. .. rst-class:: classref-item-separator
  1172. ----
  1173. .. _class_Tree_theme_style_button_hover:
  1174. .. rst-class:: classref-themeproperty
  1175. :ref:`StyleBox<class_StyleBox>` **button_hover** :ref:`๐Ÿ”—<class_Tree_theme_style_button_hover>`
  1176. :ref:`StyleBox<class_StyleBox>` used when a button in the tree is hovered.
  1177. .. rst-class:: classref-item-separator
  1178. ----
  1179. .. _class_Tree_theme_style_button_pressed:
  1180. .. rst-class:: classref-themeproperty
  1181. :ref:`StyleBox<class_StyleBox>` **button_pressed** :ref:`๐Ÿ”—<class_Tree_theme_style_button_pressed>`
  1182. :ref:`StyleBox<class_StyleBox>` used when a button in the tree is pressed.
  1183. .. rst-class:: classref-item-separator
  1184. ----
  1185. .. _class_Tree_theme_style_cursor:
  1186. .. rst-class:: classref-themeproperty
  1187. :ref:`StyleBox<class_StyleBox>` **cursor** :ref:`๐Ÿ”—<class_Tree_theme_style_cursor>`
  1188. :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **Tree** is being focused.
  1189. .. rst-class:: classref-item-separator
  1190. ----
  1191. .. _class_Tree_theme_style_cursor_unfocused:
  1192. .. rst-class:: classref-themeproperty
  1193. :ref:`StyleBox<class_StyleBox>` **cursor_unfocused** :ref:`๐Ÿ”—<class_Tree_theme_style_cursor_unfocused>`
  1194. :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **Tree** is not being focused.
  1195. .. rst-class:: classref-item-separator
  1196. ----
  1197. .. _class_Tree_theme_style_custom_button:
  1198. .. rst-class:: classref-themeproperty
  1199. :ref:`StyleBox<class_StyleBox>` **custom_button** :ref:`๐Ÿ”—<class_Tree_theme_style_custom_button>`
  1200. Default :ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell when button is enabled with :ref:`TreeItem.set_custom_as_button()<class_TreeItem_method_set_custom_as_button>`.
  1201. .. rst-class:: classref-item-separator
  1202. ----
  1203. .. _class_Tree_theme_style_custom_button_hover:
  1204. .. rst-class:: classref-themeproperty
  1205. :ref:`StyleBox<class_StyleBox>` **custom_button_hover** :ref:`๐Ÿ”—<class_Tree_theme_style_custom_button_hover>`
  1206. :ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode button cell when it's hovered.
  1207. .. rst-class:: classref-item-separator
  1208. ----
  1209. .. _class_Tree_theme_style_custom_button_pressed:
  1210. .. rst-class:: classref-themeproperty
  1211. :ref:`StyleBox<class_StyleBox>` **custom_button_pressed** :ref:`๐Ÿ”—<class_Tree_theme_style_custom_button_pressed>`
  1212. :ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode button cell when it's pressed.
  1213. .. rst-class:: classref-item-separator
  1214. ----
  1215. .. _class_Tree_theme_style_focus:
  1216. .. rst-class:: classref-themeproperty
  1217. :ref:`StyleBox<class_StyleBox>` **focus** :ref:`๐Ÿ”—<class_Tree_theme_style_focus>`
  1218. The focused style for the **Tree**, drawn on top of everything.
  1219. .. rst-class:: classref-item-separator
  1220. ----
  1221. .. _class_Tree_theme_style_hovered:
  1222. .. rst-class:: classref-themeproperty
  1223. :ref:`StyleBox<class_StyleBox>` **hovered** :ref:`๐Ÿ”—<class_Tree_theme_style_hovered>`
  1224. :ref:`StyleBox<class_StyleBox>` for the item being hovered, but not selected.
  1225. .. rst-class:: classref-item-separator
  1226. ----
  1227. .. _class_Tree_theme_style_hovered_dimmed:
  1228. .. rst-class:: classref-themeproperty
  1229. :ref:`StyleBox<class_StyleBox>` **hovered_dimmed** :ref:`๐Ÿ”—<class_Tree_theme_style_hovered_dimmed>`
  1230. :ref:`StyleBox<class_StyleBox>` for the item being hovered, while a button of the same item is hovered as the same time.
  1231. .. rst-class:: classref-item-separator
  1232. ----
  1233. .. _class_Tree_theme_style_hovered_selected:
  1234. .. rst-class:: classref-themeproperty
  1235. :ref:`StyleBox<class_StyleBox>` **hovered_selected** :ref:`๐Ÿ”—<class_Tree_theme_style_hovered_selected>`
  1236. :ref:`StyleBox<class_StyleBox>` for the hovered and selected items, used when the **Tree** is not being focused.
  1237. .. rst-class:: classref-item-separator
  1238. ----
  1239. .. _class_Tree_theme_style_hovered_selected_focus:
  1240. .. rst-class:: classref-themeproperty
  1241. :ref:`StyleBox<class_StyleBox>` **hovered_selected_focus** :ref:`๐Ÿ”—<class_Tree_theme_style_hovered_selected_focus>`
  1242. :ref:`StyleBox<class_StyleBox>` for the hovered and selected items, used when the **Tree** is being focused.
  1243. .. rst-class:: classref-item-separator
  1244. ----
  1245. .. _class_Tree_theme_style_panel:
  1246. .. rst-class:: classref-themeproperty
  1247. :ref:`StyleBox<class_StyleBox>` **panel** :ref:`๐Ÿ”—<class_Tree_theme_style_panel>`
  1248. The background style for the **Tree**.
  1249. .. rst-class:: classref-item-separator
  1250. ----
  1251. .. _class_Tree_theme_style_selected:
  1252. .. rst-class:: classref-themeproperty
  1253. :ref:`StyleBox<class_StyleBox>` **selected** :ref:`๐Ÿ”—<class_Tree_theme_style_selected>`
  1254. :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **Tree** is not being focused.
  1255. .. rst-class:: classref-item-separator
  1256. ----
  1257. .. _class_Tree_theme_style_selected_focus:
  1258. .. rst-class:: classref-themeproperty
  1259. :ref:`StyleBox<class_StyleBox>` **selected_focus** :ref:`๐Ÿ”—<class_Tree_theme_style_selected_focus>`
  1260. :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **Tree** is being focused.
  1261. .. rst-class:: classref-item-separator
  1262. ----
  1263. .. _class_Tree_theme_style_title_button_hover:
  1264. .. rst-class:: classref-themeproperty
  1265. :ref:`StyleBox<class_StyleBox>` **title_button_hover** :ref:`๐Ÿ”—<class_Tree_theme_style_title_button_hover>`
  1266. :ref:`StyleBox<class_StyleBox>` used when the title button is being hovered.
  1267. .. rst-class:: classref-item-separator
  1268. ----
  1269. .. _class_Tree_theme_style_title_button_normal:
  1270. .. rst-class:: classref-themeproperty
  1271. :ref:`StyleBox<class_StyleBox>` **title_button_normal** :ref:`๐Ÿ”—<class_Tree_theme_style_title_button_normal>`
  1272. Default :ref:`StyleBox<class_StyleBox>` for the title button.
  1273. .. rst-class:: classref-item-separator
  1274. ----
  1275. .. _class_Tree_theme_style_title_button_pressed:
  1276. .. rst-class:: classref-themeproperty
  1277. :ref:`StyleBox<class_StyleBox>` **title_button_pressed** :ref:`๐Ÿ”—<class_Tree_theme_style_title_button_pressed>`
  1278. :ref:`StyleBox<class_StyleBox>` used when the title button is being pressed.
  1279. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1280. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  1281. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1282. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1283. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1284. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1285. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1286. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1287. .. |void| replace:: :abbr:`void (No return value.)`