class_tree.rst 113 KB

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