class_tree.rst 111 KB

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