class_tree.rst 82 KB

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