mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
1819 lines
137 KiB
ReStructuredText
1819 lines
137 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_TreeItem:
|
||
|
||
TreeItem
|
||
========
|
||
|
||
**繼承:** :ref:`Object<class_Object>`
|
||
|
||
代表 :ref:`Tree<class_Tree>` 中某個專案的內部控制項。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
說明
|
||
----
|
||
|
||
:ref:`Tree<class_Tree>` 控制項中的單個專案。可以包含其他 **TreeItem** 作為子級,從而建立層級結構。還可以包含文字和按鈕。\ **TreeItem** 不是 :ref:`Node<class_Node>`\ ,在 :ref:`Tree<class_Tree>` 內部使用。
|
||
|
||
要建立 **TreeItem**\ ,請使用 :ref:`Tree.create_item()<class_Tree_method_create_item>` 或 :ref:`create_child()<class_TreeItem_method_create_child>`\ 。要移除 **TreeItem**\ ,請使用 :ref:`Object.free()<class_Object_method_free>`\ 。
|
||
|
||
\ **注意:**\ 按鈕的 ID 值為 32 位,與始終為 64 位的 :ref:`int<class_int>` 不同。取值範圍為 ``-2147483648`` 到 ``2147483647``\ 。
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
屬性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------+-----------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`collapsed<class_TreeItem_property_collapsed>` |
|
||
+-------------------------+-----------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`custom_minimum_height<class_TreeItem_property_custom_minimum_height>` |
|
||
+-------------------------+-----------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`disable_folding<class_TreeItem_property_disable_folding>` |
|
||
+-------------------------+-----------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`visible<class_TreeItem_property_visible>` |
|
||
+-------------------------+-----------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_button<class_TreeItem_method_add_button>`\ (\ column\: :ref:`int<class_int>`, button\: :ref:`Texture2D<class_Texture2D>`, id\: :ref:`int<class_int>` = -1, disabled\: :ref:`bool<class_bool>` = false, tooltip_text\: :ref:`String<class_String>` = "", description\: :ref:`String<class_String>` = ""\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_child<class_TreeItem_method_add_child>`\ (\ child\: :ref:`TreeItem<class_TreeItem>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`call_recursive<class_TreeItem_method_call_recursive>`\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_buttons<class_TreeItem_method_clear_buttons>`\ (\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_custom_bg_color<class_TreeItem_method_clear_custom_bg_color>`\ (\ column\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_custom_color<class_TreeItem_method_clear_custom_color>`\ (\ column\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`create_child<class_TreeItem_method_create_child>`\ (\ index\: :ref:`int<class_int>` = -1\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`deselect<class_TreeItem_method_deselect>`\ (\ column\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`erase_button<class_TreeItem_method_erase_button>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` | :ref:`get_auto_translate_mode<class_TreeItem_method_get_auto_translate_mode>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` | :ref:`get_autowrap_mode<class_TreeItem_method_get_autowrap_mode>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_button<class_TreeItem_method_get_button>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_button_by_id<class_TreeItem_method_get_button_by_id>`\ (\ column\: :ref:`int<class_int>`, id\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_button_color<class_TreeItem_method_get_button_color>`\ (\ column\: :ref:`int<class_int>`, id\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_button_count<class_TreeItem_method_get_button_count>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_button_id<class_TreeItem_method_get_button_id>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_button_tooltip_text<class_TreeItem_method_get_button_tooltip_text>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` | :ref:`get_cell_mode<class_TreeItem_method_get_cell_mode>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_child<class_TreeItem_method_get_child>`\ (\ index\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_child_count<class_TreeItem_method_get_child_count>`\ (\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>`\[:ref:`TreeItem<class_TreeItem>`\] | :ref:`get_children<class_TreeItem_method_get_children>`\ (\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_custom_bg_color<class_TreeItem_method_get_custom_bg_color>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_custom_color<class_TreeItem_method_get_custom_color>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Callable<class_Callable>` | :ref:`get_custom_draw_callback<class_TreeItem_method_get_custom_draw_callback>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`get_custom_font<class_TreeItem_method_get_custom_font>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_custom_font_size<class_TreeItem_method_get_custom_font_size>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`get_custom_stylebox<class_TreeItem_method_get_custom_stylebox>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_description<class_TreeItem_method_get_description>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`get_expand_right<class_TreeItem_method_get_expand_right>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_first_child<class_TreeItem_method_get_first_child>`\ (\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_icon<class_TreeItem_method_get_icon>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_icon_max_width<class_TreeItem_method_get_icon_max_width>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_icon_modulate<class_TreeItem_method_get_icon_modulate>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_icon_overlay<class_TreeItem_method_get_icon_overlay>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Rect2<class_Rect2>` | :ref:`get_icon_region<class_TreeItem_method_get_icon_region>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_index<class_TreeItem_method_get_index>`\ (\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_language<class_TreeItem_method_get_language>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`get_metadata<class_TreeItem_method_get_metadata>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_next<class_TreeItem_method_get_next>`\ (\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_in_tree<class_TreeItem_method_get_next_in_tree>`\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_visible<class_TreeItem_method_get_next_visible>`\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_parent<class_TreeItem_method_get_parent>`\ (\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev<class_TreeItem_method_get_prev>`\ (\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_in_tree<class_TreeItem_method_get_prev_in_tree>`\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_visible<class_TreeItem_method_get_prev_visible>`\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_range<class_TreeItem_method_get_range>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_range_config<class_TreeItem_method_get_range_config>`\ (\ column\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`get_structured_text_bidi_override<class_TreeItem_method_get_structured_text_bidi_override>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>` | :ref:`get_structured_text_bidi_override_options<class_TreeItem_method_get_structured_text_bidi_override_options>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_suffix<class_TreeItem_method_get_suffix>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_text<class_TreeItem_method_get_text>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`get_text_alignment<class_TreeItem_method_get_text_alignment>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_text_direction<class_TreeItem_method_get_text_direction>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`get_text_overrun_behavior<class_TreeItem_method_get_text_overrun_behavior>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_tooltip_text<class_TreeItem_method_get_tooltip_text>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Tree<class_Tree>` | :ref:`get_tree<class_TreeItem_method_get_tree>`\ (\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_any_collapsed<class_TreeItem_method_is_any_collapsed>`\ (\ only_visible\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_button_disabled<class_TreeItem_method_is_button_disabled>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_checked<class_TreeItem_method_is_checked>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_custom_set_as_button<class_TreeItem_method_is_custom_set_as_button>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_edit_multiline<class_TreeItem_method_is_edit_multiline>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_editable<class_TreeItem_method_is_editable>`\ (\ column\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_indeterminate<class_TreeItem_method_is_indeterminate>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_selectable<class_TreeItem_method_is_selectable>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_selected<class_TreeItem_method_is_selected>`\ (\ column\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_visible_in_tree<class_TreeItem_method_is_visible_in_tree>`\ (\ ) |const| |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`move_after<class_TreeItem_method_move_after>`\ (\ item\: :ref:`TreeItem<class_TreeItem>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`move_before<class_TreeItem_method_move_before>`\ (\ item\: :ref:`TreeItem<class_TreeItem>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`propagate_check<class_TreeItem_method_propagate_check>`\ (\ column\: :ref:`int<class_int>`, emit_signal\: :ref:`bool<class_bool>` = true\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_child<class_TreeItem_method_remove_child>`\ (\ child\: :ref:`TreeItem<class_TreeItem>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`select<class_TreeItem_method_select>`\ (\ column\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_auto_translate_mode<class_TreeItem_method_set_auto_translate_mode>`\ (\ column\: :ref:`int<class_int>`, mode\: :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_autowrap_mode<class_TreeItem_method_set_autowrap_mode>`\ (\ column\: :ref:`int<class_int>`, autowrap_mode\: :ref:`AutowrapMode<enum_TextServer_AutowrapMode>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_button<class_TreeItem_method_set_button>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, button\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_button_color<class_TreeItem_method_set_button_color>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_button_description<class_TreeItem_method_set_button_description>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, description\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_button_disabled<class_TreeItem_method_set_button_disabled>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_button_tooltip_text<class_TreeItem_method_set_button_tooltip_text>`\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_cell_mode<class_TreeItem_method_set_cell_mode>`\ (\ column\: :ref:`int<class_int>`, mode\: :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_checked<class_TreeItem_method_set_checked>`\ (\ column\: :ref:`int<class_int>`, checked\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_collapsed_recursive<class_TreeItem_method_set_collapsed_recursive>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_as_button<class_TreeItem_method_set_custom_as_button>`\ (\ column\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_bg_color<class_TreeItem_method_set_custom_bg_color>`\ (\ column\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`, just_outline\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_color<class_TreeItem_method_set_custom_color>`\ (\ column\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_draw<class_TreeItem_method_set_custom_draw>`\ (\ column\: :ref:`int<class_int>`, object\: :ref:`Object<class_Object>`, callback\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_draw_callback<class_TreeItem_method_set_custom_draw_callback>`\ (\ column\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_font<class_TreeItem_method_set_custom_font>`\ (\ column\: :ref:`int<class_int>`, font\: :ref:`Font<class_Font>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_font_size<class_TreeItem_method_set_custom_font_size>`\ (\ column\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_custom_stylebox<class_TreeItem_method_set_custom_stylebox>`\ (\ column\: :ref:`int<class_int>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_description<class_TreeItem_method_set_description>`\ (\ column\: :ref:`int<class_int>`, description\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_edit_multiline<class_TreeItem_method_set_edit_multiline>`\ (\ column\: :ref:`int<class_int>`, multiline\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_editable<class_TreeItem_method_set_editable>`\ (\ column\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_expand_right<class_TreeItem_method_set_expand_right>`\ (\ column\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_icon<class_TreeItem_method_set_icon>`\ (\ column\: :ref:`int<class_int>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_icon_max_width<class_TreeItem_method_set_icon_max_width>`\ (\ column\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_icon_modulate<class_TreeItem_method_set_icon_modulate>`\ (\ column\: :ref:`int<class_int>`, modulate\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_icon_overlay<class_TreeItem_method_set_icon_overlay>`\ (\ column\: :ref:`int<class_int>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_icon_region<class_TreeItem_method_set_icon_region>`\ (\ column\: :ref:`int<class_int>`, region\: :ref:`Rect2<class_Rect2>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_indeterminate<class_TreeItem_method_set_indeterminate>`\ (\ column\: :ref:`int<class_int>`, indeterminate\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_language<class_TreeItem_method_set_language>`\ (\ column\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_metadata<class_TreeItem_method_set_metadata>`\ (\ column\: :ref:`int<class_int>`, meta\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_range<class_TreeItem_method_set_range>`\ (\ column\: :ref:`int<class_int>`, value\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_range_config<class_TreeItem_method_set_range_config>`\ (\ column\: :ref:`int<class_int>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`, step\: :ref:`float<class_float>`, expr\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_selectable<class_TreeItem_method_set_selectable>`\ (\ column\: :ref:`int<class_int>`, selectable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_structured_text_bidi_override<class_TreeItem_method_set_structured_text_bidi_override>`\ (\ column\: :ref:`int<class_int>`, parser\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_structured_text_bidi_override_options<class_TreeItem_method_set_structured_text_bidi_override_options>`\ (\ column\: :ref:`int<class_int>`, args\: :ref:`Array<class_Array>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_suffix<class_TreeItem_method_set_suffix>`\ (\ column\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_text<class_TreeItem_method_set_text>`\ (\ column\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_text_alignment<class_TreeItem_method_set_text_alignment>`\ (\ column\: :ref:`int<class_int>`, text_alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_text_direction<class_TreeItem_method_set_text_direction>`\ (\ column\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_text_overrun_behavior<class_TreeItem_method_set_text_overrun_behavior>`\ (\ column\: :ref:`int<class_int>`, overrun_behavior\: :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_tooltip_text<class_TreeItem_method_set_tooltip_text>`\ (\ column\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`uncollapse_tree<class_TreeItem_method_uncollapse_tree>`\ (\ ) |
|
||
+-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
列舉
|
||
----
|
||
|
||
.. _enum_TreeItem_TreeCellMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **TreeCellMode**: :ref:`🔗<enum_TreeItem_TreeCellMode>`
|
||
|
||
.. _class_TreeItem_constant_CELL_MODE_STRING:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_STRING** = ``0``
|
||
|
||
Cell shows a string label, optionally with an icon. When editable, the text can be edited using a :ref:`LineEdit<class_LineEdit>`, or a :ref:`TextEdit<class_TextEdit>` popup if :ref:`set_edit_multiline()<class_TreeItem_method_set_edit_multiline>` is used.
|
||
|
||
.. _class_TreeItem_constant_CELL_MODE_CHECK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_CHECK** = ``1``
|
||
|
||
Cell shows a checkbox, optionally with text and an icon. The checkbox can be pressed, released, or indeterminate (via :ref:`set_indeterminate()<class_TreeItem_method_set_indeterminate>`). The checkbox can't be clicked unless the cell is editable.
|
||
|
||
.. _class_TreeItem_constant_CELL_MODE_RANGE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_RANGE** = ``2``
|
||
|
||
Cell shows a numeric range. When editable, it can be edited using a range slider. Use :ref:`set_range()<class_TreeItem_method_set_range>` to set the value and :ref:`set_range_config()<class_TreeItem_method_set_range_config>` to configure the range.
|
||
|
||
This cell can also be used in a text dropdown mode when you assign a text with :ref:`set_text()<class_TreeItem_method_set_text>`. Separate options with a comma, e.g. ``"Option1,Option2,Option3"``.
|
||
|
||
.. _class_TreeItem_constant_CELL_MODE_ICON:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_ICON** = ``3``
|
||
|
||
Cell shows an icon. It can't be edited nor display text. The icon is always centered within the cell.
|
||
|
||
.. _class_TreeItem_constant_CELL_MODE_CUSTOM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_CUSTOM** = ``4``
|
||
|
||
Cell shows as a clickable button. It will display an arrow similar to :ref:`OptionButton<class_OptionButton>`, but doesn't feature a dropdown (for that you can use :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>`). Clicking the button emits the :ref:`Tree.item_edited<class_Tree_signal_item_edited>` signal. The button is flat by default, you can use :ref:`set_custom_as_button()<class_TreeItem_method_set_custom_as_button>` to display it with a :ref:`StyleBox<class_StyleBox>`.
|
||
|
||
This mode also supports custom drawing using :ref:`set_custom_draw_callback()<class_TreeItem_method_set_custom_draw_callback>`.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
屬性說明
|
||
--------
|
||
|
||
.. _class_TreeItem_property_collapsed:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **collapsed** :ref:`🔗<class_TreeItem_property_collapsed>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_collapsed**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_collapsed**\ (\ )
|
||
|
||
如果為 ``true``\ ,則該 TreeItem 被折疊。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_property_custom_minimum_height:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **custom_minimum_height** :ref:`🔗<class_TreeItem_property_custom_minimum_height>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_custom_minimum_height**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_custom_minimum_height**\ (\ )
|
||
|
||
自訂最小高度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_property_disable_folding:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **disable_folding** :ref:`🔗<class_TreeItem_property_disable_folding>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_disable_folding**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_folding_disabled**\ (\ )
|
||
|
||
如果為 ``true``\ ,則這個 TreeItem 禁用折疊。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_property_visible:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **visible** :ref:`🔗<class_TreeItem_property_visible>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_visible**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_visible**\ (\ )
|
||
|
||
如果為 ``true``\ ,則該 **TreeItem** 可見(預設)。
|
||
|
||
請注意,如果將 **TreeItem** 設定為不可見,則其子項也將不可見。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法說明
|
||
--------
|
||
|
||
.. _class_TreeItem_method_add_button:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_button**\ (\ column\: :ref:`int<class_int>`, button\: :ref:`Texture2D<class_Texture2D>`, id\: :ref:`int<class_int>` = -1, disabled\: :ref:`bool<class_bool>` = false, tooltip_text\: :ref:`String<class_String>` = "", description\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_TreeItem_method_add_button>`
|
||
|
||
Adds a button with :ref:`Texture2D<class_Texture2D>` ``button`` to the end of the cell at column ``column``. The ``id`` is used to identify the button in the according :ref:`Tree.button_clicked<class_Tree_signal_button_clicked>` signal and can be different from the buttons index. If not specified, the next available index is used, which may be retrieved by calling :ref:`get_button_count()<class_TreeItem_method_get_button_count>` immediately before this method. Optionally, the button can be ``disabled`` and have a ``tooltip_text``. ``description`` is used as the button description for assistive apps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_add_child:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_child**\ (\ child\: :ref:`TreeItem<class_TreeItem>`\ ) :ref:`🔗<class_TreeItem_method_add_child>`
|
||
|
||
將已解除父子關係的 **TreeItem** 新增為這個樹項的直接子項。\ ``child`` 樹項必須不是任何 :ref:`Tree<class_Tree>` 的一部分,也不能有任何 **TreeItem** 父級。另見 :ref:`remove_child()<class_TreeItem_method_remove_child>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_call_recursive:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **call_recursive**\ (\ method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| :ref:`🔗<class_TreeItem_method_call_recursive>`
|
||
|
||
遞迴呼叫在實際 TreeItem 及其子項上的 ``method``\ 。將參數作為一個逗號分隔列表傳遞。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_clear_buttons:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_buttons**\ (\ ) :ref:`🔗<class_TreeItem_method_clear_buttons>`
|
||
|
||
Removes all buttons from all columns of this item.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_clear_custom_bg_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_custom_bg_color**\ (\ column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_clear_custom_bg_color>`
|
||
|
||
重設指定列預設的背景顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_clear_custom_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_custom_color**\ (\ column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_clear_custom_color>`
|
||
|
||
重設指定列預設的顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_create_child:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **create_child**\ (\ index\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TreeItem_method_create_child>`
|
||
|
||
建立專案並新增為子項。
|
||
|
||
新建的專案會插入到索引 ``index`` 位置(預設的 ``-1`` 表示最後的位置),如果 ``index`` 比子項數量大則會作為最後一項。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_deselect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **deselect**\ (\ column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_deselect>`
|
||
|
||
取消選擇指定列。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_erase_button:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **erase_button**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_erase_button>`
|
||
|
||
刪除列 ``column`` 中索引 ``button_index`` 處的按鈕。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_auto_translate_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **get_auto_translate_mode**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_auto_translate_mode>`
|
||
|
||
Returns the column's auto translate mode.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_autowrap_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **get_autowrap_mode**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_autowrap_mode>`
|
||
|
||
返回給定列 ``column`` 的文字自動換行模式。預設為 :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_button:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **get_button**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_button>`
|
||
|
||
返回在 ``column`` 列中索引為 ``button_index`` 的按鈕的 :ref:`Texture<class_Texture>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_button_by_id:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_button_by_id**\ (\ column\: :ref:`int<class_int>`, id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_button_by_id>`
|
||
|
||
如果在 ``column`` 列中存在 ID 為 ``id`` 的按鈕,則返回其索引號,否則返回 -1。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_button_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_button_color**\ (\ column\: :ref:`int<class_int>`, id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_button_color>`
|
||
|
||
Returns the color of the button with ID ``id`` in column ``column``. If the specified button does not exist, returns :ref:`Color.BLACK<class_Color_constant_BLACK>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_button_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_button_count**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_button_count>`
|
||
|
||
返回在 ``column`` 列中按鈕的數量。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_button_id:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_button_id**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_button_id>`
|
||
|
||
返回在 ``column`` 列中索引為 ``button_index`` 的按鈕的 ID。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_button_tooltip_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_button_tooltip_text**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_button_tooltip_text>`
|
||
|
||
返回在 ``column`` 列中索引為 ``button_index`` 的按鈕的工具提示字元串。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_cell_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **get_cell_mode**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_cell_mode>`
|
||
|
||
返回該列的儲存格模式。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_child:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_child**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_get_child>`
|
||
|
||
按其 ``index`` 返回一個子項(參見 :ref:`get_child_count()<class_TreeItem_method_get_child_count>`\ )。該方法通常被用於反覆運算一個專案的所有子項。
|
||
|
||
負索引將從最後一個存取孩子。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_child_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_child_count**\ (\ ) :ref:`🔗<class_TreeItem_method_get_child_count>`
|
||
|
||
返回子項的數量。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_children:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Array<class_Array>`\[:ref:`TreeItem<class_TreeItem>`\] **get_children**\ (\ ) :ref:`🔗<class_TreeItem_method_get_children>`
|
||
|
||
返回引用該專案子級的陣列。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_custom_bg_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_custom_bg_color**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_custom_bg_color>`
|
||
|
||
返回列 ``column`` 的自訂背景色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_custom_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_custom_color**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_custom_color>`
|
||
|
||
返回列 ``column`` 的自訂顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_custom_draw_callback:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Callable<class_Callable>` **get_custom_draw_callback**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_custom_draw_callback>`
|
||
|
||
Returns the custom callback of column ``column``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_custom_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Font<class_Font>` **get_custom_font**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_custom_font>`
|
||
|
||
返回用於在 ``column`` 列繪製文字的自訂字形。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_custom_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_custom_font_size**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_custom_font_size>`
|
||
|
||
返回用於在 ``column`` 列繪製文字的自訂字形大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_custom_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **get_custom_stylebox**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_custom_stylebox>`
|
||
|
||
Returns the given column's custom :ref:`StyleBox<class_StyleBox>` used to draw the background.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_description:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_description**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_description>`
|
||
|
||
Returns the given column's description for assistive apps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_expand_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **get_expand_right**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_expand_right>`
|
||
|
||
如果設定了 ``expand_right``\ ,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_first_child:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_first_child**\ (\ ) |const| :ref:`🔗<class_TreeItem_method_get_first_child>`
|
||
|
||
返回該 TreeItem 的第一個子項。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **get_icon**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_icon>`
|
||
|
||
返回給定列的圖示 :ref:`Texture2D<class_Texture2D>`\ 。如果未設定圖示,則會出錯。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_icon_max_width:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_icon_max_width**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_icon_max_width>`
|
||
|
||
返回給定列 ``column`` 中圖示所允許的最大寬度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_icon_modulate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_icon_modulate**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_icon_modulate>`
|
||
|
||
返回調變列的圖示的 :ref:`Color<class_Color>` 顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_icon_overlay:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **get_icon_overlay**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_icon_overlay>`
|
||
|
||
Returns the given column's icon overlay :ref:`Texture2D<class_Texture2D>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_icon_region:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Rect2<class_Rect2>` **get_icon_region**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_icon_region>`
|
||
|
||
返回圖示 :ref:`Texture2D<class_Texture2D>` 的區域,型別為 :ref:`Rect2<class_Rect2>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_index:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_index**\ (\ ) :ref:`🔗<class_TreeItem_method_get_index>`
|
||
|
||
返回該節點在樹中的順序。例如對第一個子項呼叫時,得到的位置為 ``0``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_language:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_language**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_language>`
|
||
|
||
返回專案文字的語言程式碼。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_metadata:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **get_metadata**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_metadata>`
|
||
|
||
返回使用 :ref:`set_metadata()<class_TreeItem_method_set_metadata>` 為指定列設定的中繼資料。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_next:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_next**\ (\ ) |const| :ref:`🔗<class_TreeItem_method_get_next>`
|
||
|
||
Returns the next sibling TreeItem in the tree or a ``null`` object if there is none.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_next_in_tree:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_next_in_tree**\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_TreeItem_method_get_next_in_tree>`
|
||
|
||
返回樹中下一個同級 TreeItem(按照深度優先搜尋循序),如果不存在則返回 ``null`` 對象。
|
||
|
||
如果啟用了 ``wrap``\ ,則當在最後一個元素上調用時,該方法將繞回到樹中的第一個元素,否則它將返回 ``null``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_next_visible:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_next_visible**\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_TreeItem_method_get_next_visible>`
|
||
|
||
返回樹中下一個可見的同級 TreeItem(按照深度優先循序搜尋),如果不存在則返回 ``null`` 對象。
|
||
|
||
如果啟用了 ``wrap``\ ,則當在最後一個元素上調用時,該方法將繞回到樹中的第一個可見元素,否則它將返回 ``null``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_parent:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_parent**\ (\ ) |const| :ref:`🔗<class_TreeItem_method_get_parent>`
|
||
|
||
Returns the parent TreeItem or a ``null`` object if there is none.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_prev:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_prev**\ (\ ) :ref:`🔗<class_TreeItem_method_get_prev>`
|
||
|
||
Returns the previous sibling TreeItem in the tree or a ``null`` object if there is none.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_prev_in_tree:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_prev_in_tree**\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_TreeItem_method_get_prev_in_tree>`
|
||
|
||
返回樹中前一個同級 TreeItem(按照深度優先循序搜尋),如果不存在則返回 ``null`` 對象。
|
||
|
||
如果啟用了 ``wrap``\ ,則在第一個可見元素上呼叫時,該方法將環繞到樹中的最後一個可見元素,否則它將返回 ``null``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_prev_visible:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TreeItem<class_TreeItem>` **get_prev_visible**\ (\ wrap\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_TreeItem_method_get_prev_visible>`
|
||
|
||
返回樹中前一個可見的同級 TreeItem(按照深度優先搜尋循序),如果不存在則返回 ``null`` 對象。
|
||
|
||
如果啟用了 ``wrap``\ ,則在第一個可見元素上呼叫時,該方法將繞回到樹中的最後一個可見元素,否則它將返回 ``null``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_range:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_range**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_range>`
|
||
|
||
返回 :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` 列的值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_range_config:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Dictionary<class_Dictionary>` **get_range_config**\ (\ column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_get_range_config>`
|
||
|
||
返回包含給定列的範圍參數的字典。鍵是“min”、“max”、“step”和“expr”。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_structured_text_bidi_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_structured_text_bidi_override>`
|
||
|
||
Returns the BiDi algorithm override set for this cell.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_structured_text_bidi_override_options:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Array<class_Array>` **get_structured_text_bidi_override_options**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_structured_text_bidi_override_options>`
|
||
|
||
Returns the additional BiDi options set for this cell.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_suffix:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_suffix**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_suffix>`
|
||
|
||
獲取顯示在列值後面的後綴字串。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_text**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_text>`
|
||
|
||
返回給定列的文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_text_alignment:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_text_alignment**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_text_alignment>`
|
||
|
||
返回給定列的文字對齊方式。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_text_direction:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_text_direction>`
|
||
|
||
返回專案文字的基礎書寫方向。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_text_overrun_behavior:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **get_text_overrun_behavior**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_text_overrun_behavior>`
|
||
|
||
返回給定列 ``column`` 的文字自動換行模式。預設為 :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_tooltip_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_tooltip_text**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_get_tooltip_text>`
|
||
|
||
設定給定列的工具提示文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_get_tree:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Tree<class_Tree>` **get_tree**\ (\ ) |const| :ref:`🔗<class_TreeItem_method_get_tree>`
|
||
|
||
返回擁有此 TreeItem 的 :ref:`Tree<class_Tree>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_any_collapsed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_any_collapsed**\ (\ only_visible\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_TreeItem_method_is_any_collapsed>`
|
||
|
||
如果這個 **TreeItem** 或其任意子級為折疊狀態,則返回 ``true``\ 。
|
||
|
||
如果 ``only_visible`` 為 ``true``\ ,則會忽略不可見的 **TreeItem**\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_button_disabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_button_disabled**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_is_button_disabled>`
|
||
|
||
如果給定列 ``column`` 上索引為 ``button_index`` 的按鈕被禁用,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_checked:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_checked**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_is_checked>`
|
||
|
||
如果給定的列 ``column`` 被勾選,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_custom_set_as_button:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_custom_set_as_button**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_is_custom_set_as_button>`
|
||
|
||
Returns ``true`` if the cell was made into a button with :ref:`set_custom_as_button()<class_TreeItem_method_set_custom_as_button>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_edit_multiline:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_edit_multiline**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_is_edit_multiline>`
|
||
|
||
如果給定的列 ``column`` 可多行編輯,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_editable:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_editable**\ (\ column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_is_editable>`
|
||
|
||
如果給定的列 ``column`` 可編輯,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_indeterminate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_indeterminate**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_is_indeterminate>`
|
||
|
||
如果給定的列 ``column`` 未確定,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_selectable:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_selectable**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TreeItem_method_is_selectable>`
|
||
|
||
如果給定的列 ``column`` 可選,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_selected:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_selected**\ (\ column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_is_selected>`
|
||
|
||
如果給定的列 ``column`` 被選中,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_is_visible_in_tree:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_visible_in_tree**\ (\ ) |const| :ref:`🔗<class_TreeItem_method_is_visible_in_tree>`
|
||
|
||
Returns ``true`` if :ref:`visible<class_TreeItem_property_visible>` is ``true`` and all its ancestors are also visible.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_move_after:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **move_after**\ (\ item\: :ref:`TreeItem<class_TreeItem>`\ ) :ref:`🔗<class_TreeItem_method_move_after>`
|
||
|
||
將這個 TreeItem 移動至給定的 ``item`` 之後。
|
||
|
||
\ **注意:**\ 無法移動至根部,也無法移動根部。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_move_before:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **move_before**\ (\ item\: :ref:`TreeItem<class_TreeItem>`\ ) :ref:`🔗<class_TreeItem_method_move_before>`
|
||
|
||
將這個 TreeItem 移動至給定的 ``item`` 之前。
|
||
|
||
\ **注意:**\ 無法移動至根部,也無法移動根部。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_propagate_check:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **propagate_check**\ (\ column\: :ref:`int<class_int>`, emit_signal\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_TreeItem_method_propagate_check>`
|
||
|
||
將該項的勾選狀態傳播給給定 ``column`` 的子項和父項。可以通過連接到 :ref:`Tree.check_propagated_to_item<class_Tree_signal_check_propagated_to_item>` 來處理受該方法呼叫影響的專案。受影響的專案的處理順序如下:呼叫該方法的專案、該項的子項,最後是該項的父項。如果 ``emit_signal`` 為 ``false``\ ,則不會發出 :ref:`Tree.check_propagated_to_item<class_Tree_signal_check_propagated_to_item>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_remove_child:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_child**\ (\ child\: :ref:`TreeItem<class_TreeItem>`\ ) :ref:`🔗<class_TreeItem_method_remove_child>`
|
||
|
||
將給定的子項 **TreeItem** 和它的所有子項從 :ref:`Tree<class_Tree>` 中移除。注意,它並未從記憶體中釋放該項,所以之後可重新使用(見 :ref:`add_child()<class_TreeItem_method_add_child>`\ )。要完全刪除 **TreeItem**\ ,請使用 :ref:`Object.free()<class_Object_method_free>`\ 。
|
||
|
||
\ **注意:**\ 如果你想要將一個子項移動到其他 :ref:`Tree<class_Tree>` 中,則不必手動先移除再添加,你可以使用 :ref:`move_before()<class_TreeItem_method_move_before>` 或 :ref:`move_after()<class_TreeItem_method_move_after>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_select:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **select**\ (\ column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_select>`
|
||
|
||
選中 ``column`` 指定的列。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_auto_translate_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_auto_translate_mode**\ (\ column\: :ref:`int<class_int>`, mode\: :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`\ ) :ref:`🔗<class_TreeItem_method_set_auto_translate_mode>`
|
||
|
||
Sets the given column's auto translate mode to ``mode``.
|
||
|
||
All columns use :ref:`Node.AUTO_TRANSLATE_MODE_INHERIT<class_Node_constant_AUTO_TRANSLATE_MODE_INHERIT>` by default, which uses the same auto translate mode as the :ref:`Tree<class_Tree>` itself.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_autowrap_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_autowrap_mode**\ (\ column\: :ref:`int<class_int>`, autowrap_mode\: :ref:`AutowrapMode<enum_TextServer_AutowrapMode>`\ ) :ref:`🔗<class_TreeItem_method_set_autowrap_mode>`
|
||
|
||
設定給定 ``column`` 的自動換行模式。如果設定為 :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>` 以外的值,則文字將在節點的邊界矩形內換行。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_button:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_button**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, button\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_TreeItem_method_set_button>`
|
||
|
||
將給定列中索引為 ``button_index`` 的按鈕 :ref:`Texture2D<class_Texture2D>` 設定為 ``button``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_button_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_button_color**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_TreeItem_method_set_button_color>`
|
||
|
||
將給定列中索引為 ``button_index`` 的按鈕顏色設定為 ``color``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_button_description:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_button_description**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, description\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TreeItem_method_set_button_description>`
|
||
|
||
Sets the given column's button description at index ``button_index`` for assistive apps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_button_disabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_button_disabled**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_button_disabled>`
|
||
|
||
如果為 ``true``\ ,則禁用給定列 ``column`` 中索引為 ``button_index`` 的按鈕。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_button_tooltip_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_button_tooltip_text**\ (\ column\: :ref:`int<class_int>`, button_index\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TreeItem_method_set_button_tooltip_text>`
|
||
|
||
返回在 ``column`` 列中索引為 ``button_index`` 的按鈕的工具提示字元串。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_cell_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_cell_mode**\ (\ column\: :ref:`int<class_int>`, mode\: :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>`\ ) :ref:`🔗<class_TreeItem_method_set_cell_mode>`
|
||
|
||
Sets the given column's cell mode to ``mode``. This determines how the cell is displayed and edited.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_checked:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_checked**\ (\ column\: :ref:`int<class_int>`, checked\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_checked>`
|
||
|
||
如果 ``checked`` 為 ``true``\ ,則給定列 ``column`` 處於勾選狀態。會清空該列的中間狀態。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_collapsed_recursive:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_collapsed_recursive**\ (\ enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_collapsed_recursive>`
|
||
|
||
折疊或展開該 **TreeItem** 及該項的所有子級。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_as_button:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_as_button**\ (\ column\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_custom_as_button>`
|
||
|
||
Makes a cell with :ref:`CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` display as a non-flat button with a :ref:`StyleBox<class_StyleBox>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_bg_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_bg_color**\ (\ column\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`, just_outline\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_TreeItem_method_set_custom_bg_color>`
|
||
|
||
Sets the given column's custom background color and whether to just use it as an outline.
|
||
|
||
\ **Note:** If a custom :ref:`StyleBox<class_StyleBox>` is set, the background color will be drawn behind it.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_color**\ (\ column\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_TreeItem_method_set_custom_color>`
|
||
|
||
設定給定列的自訂顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_draw:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_draw**\ (\ column\: :ref:`int<class_int>`, object\: :ref:`Object<class_Object>`, callback\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_TreeItem_method_set_custom_draw>`
|
||
|
||
**已棄用:** Use :ref:`set_custom_draw_callback()<class_TreeItem_method_set_custom_draw_callback>` instead.
|
||
|
||
Sets the given column's custom draw callback to the ``callback`` method on ``object``.
|
||
|
||
The method named ``callback`` should accept two arguments: the **TreeItem** that is drawn and its position and size as a :ref:`Rect2<class_Rect2>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_draw_callback:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_draw_callback**\ (\ column\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ ) :ref:`🔗<class_TreeItem_method_set_custom_draw_callback>`
|
||
|
||
Sets the given column's custom draw callback. Use an empty :ref:`Callable<class_Callable>` (``Callable()``) to clear the custom callback. The cell has to be in :ref:`CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` to use this feature.
|
||
|
||
The ``callback`` should accept two arguments: the **TreeItem** that is drawn and its position and size as a :ref:`Rect2<class_Rect2>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_font**\ (\ column\: :ref:`int<class_int>`, font\: :ref:`Font<class_Font>`\ ) :ref:`🔗<class_TreeItem_method_set_custom_font>`
|
||
|
||
設定用於在給定列 ``column`` 中繪製文字的自訂字形。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_font_size**\ (\ column\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_set_custom_font_size>`
|
||
|
||
設定用於在給定列 ``column`` 中繪製文字的自訂字形大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_custom_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_custom_stylebox**\ (\ column\: :ref:`int<class_int>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) :ref:`🔗<class_TreeItem_method_set_custom_stylebox>`
|
||
|
||
Sets the given column's custom :ref:`StyleBox<class_StyleBox>` used to draw the background.
|
||
|
||
\ **Note:** If a custom background color is set, the :ref:`StyleBox<class_StyleBox>` will be drawn in front of it.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_description:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_description**\ (\ column\: :ref:`int<class_int>`, description\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TreeItem_method_set_description>`
|
||
|
||
Sets the given column's description for assistive apps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_edit_multiline:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_edit_multiline**\ (\ column\: :ref:`int<class_int>`, multiline\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_edit_multiline>`
|
||
|
||
如果 ``multiline`` 為 ``true``\ ,則給定的列 ``column`` 可進行多行編輯。
|
||
|
||
\ **注意:**\ 這個選項僅影響編輯該列時所出現控制項的型別(\ :ref:`LineEdit<class_LineEdit>` 或 :ref:`TextEdit<class_TextEdit>`\ )。即便該列不可進行多行編輯,也可以通過 :ref:`set_text()<class_TreeItem_method_set_text>` 來設定多行的值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_editable:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_editable**\ (\ column\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_editable>`
|
||
|
||
如果 ``enabled`` 為 ``true``\ ,則給定的列 ``column`` 可編輯。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_expand_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_expand_right**\ (\ column\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_expand_right>`
|
||
|
||
如果 ``enable`` 為 ``true``\ ,則給定的列 ``column`` 向右擴展。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_icon**\ (\ column\: :ref:`int<class_int>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_TreeItem_method_set_icon>`
|
||
|
||
Sets the given cell's icon :ref:`Texture2D<class_Texture2D>`. If the cell is in :ref:`CELL_MODE_ICON<class_TreeItem_constant_CELL_MODE_ICON>` mode, the icon is displayed in the center of the cell. Otherwise, the icon is displayed before the cell's text. :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` does not display an icon.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_icon_max_width:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_icon_max_width**\ (\ column\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TreeItem_method_set_icon_max_width>`
|
||
|
||
設定給定列 ``column`` 所允許的最大圖示寬度。這是在圖示預設大小和 :ref:`Tree.icon_max_width<class_Tree_theme_constant_icon_max_width>` 的基礎上的限制。高度會根據圖示的長寬比調整。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_icon_modulate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_icon_modulate**\ (\ column\: :ref:`int<class_int>`, modulate\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_TreeItem_method_set_icon_modulate>`
|
||
|
||
用 ``modulate`` 調變給定列的圖示。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_icon_overlay:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_icon_overlay**\ (\ column\: :ref:`int<class_int>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_TreeItem_method_set_icon_overlay>`
|
||
|
||
Sets the given cell's icon overlay :ref:`Texture2D<class_Texture2D>`. The cell has to be in :ref:`CELL_MODE_ICON<class_TreeItem_constant_CELL_MODE_ICON>` mode, and icon has to be set. Overlay is drawn on top of icon, in the bottom left corner.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_icon_region:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_icon_region**\ (\ column\: :ref:`int<class_int>`, region\: :ref:`Rect2<class_Rect2>`\ ) :ref:`🔗<class_TreeItem_method_set_icon_region>`
|
||
|
||
設定給定列的圖示的紋理區域。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_indeterminate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_indeterminate**\ (\ column\: :ref:`int<class_int>`, indeterminate\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_indeterminate>`
|
||
|
||
如果 ``indeterminate`` 為 ``true``\ ,則給定列 ``column`` 被標記為未決狀態。
|
||
|
||
\ **注意:**\ 如果從 ``false`` 設定為 ``true``\ ,則該列的勾選狀態會被清除。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_language:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_language**\ (\ column\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TreeItem_method_set_language>`
|
||
|
||
Sets the language code of the given ``column``'s text to ``language``. This is used for line-breaking and text shaping algorithms. If ``language`` is empty, the current locale is used.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_metadata:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_metadata**\ (\ column\: :ref:`int<class_int>`, meta\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_TreeItem_method_set_metadata>`
|
||
|
||
設定給定列的中繼資料,之後可用 :ref:`get_metadata()<class_TreeItem_method_get_metadata>` 進行檢索。例如,這可用於存儲對原始資料的引用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_range:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_range**\ (\ column\: :ref:`int<class_int>`, value\: :ref:`float<class_float>`\ ) :ref:`🔗<class_TreeItem_method_set_range>`
|
||
|
||
設定 :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` 列的值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_range_config:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_range_config**\ (\ column\: :ref:`int<class_int>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`, step\: :ref:`float<class_float>`, expr\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_TreeItem_method_set_range_config>`
|
||
|
||
設定列的可接受值的範圍。該列必須處於 :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` 模式。
|
||
|
||
如果 ``expr`` 為 ``true``\ ,則編輯模式滑桿將使用與 :ref:`Range.exp_edit<class_Range_property_exp_edit>` 一樣的指數刻度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_selectable:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_selectable**\ (\ column\: :ref:`int<class_int>`, selectable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TreeItem_method_set_selectable>`
|
||
|
||
如果 ``selectable`` 為 ``true``\ ,則給定列 ``column`` 可選。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_structured_text_bidi_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_structured_text_bidi_override**\ (\ column\: :ref:`int<class_int>`, parser\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ ) :ref:`🔗<class_TreeItem_method_set_structured_text_bidi_override>`
|
||
|
||
Set BiDi algorithm override for the structured text. Has effect for cells that display text.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_structured_text_bidi_override_options:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_structured_text_bidi_override_options**\ (\ column\: :ref:`int<class_int>`, args\: :ref:`Array<class_Array>`\ ) :ref:`🔗<class_TreeItem_method_set_structured_text_bidi_override_options>`
|
||
|
||
Set additional options for BiDi override. Has effect for cells that display text.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_suffix:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_suffix**\ (\ column\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TreeItem_method_set_suffix>`
|
||
|
||
設定字串,顯示在列的值之後(例如,單位的縮寫)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_text**\ (\ column\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TreeItem_method_set_text>`
|
||
|
||
設定給定列的文字值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_text_alignment:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_text_alignment**\ (\ column\: :ref:`int<class_int>`, text_alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ ) :ref:`🔗<class_TreeItem_method_set_text_alignment>`
|
||
|
||
Sets the given column's text alignment to ``text_alignment``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_text_direction:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_text_direction**\ (\ column\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) :ref:`🔗<class_TreeItem_method_set_text_direction>`
|
||
|
||
設定專案文字的基礎書寫方向。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_text_overrun_behavior:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_text_overrun_behavior**\ (\ column\: :ref:`int<class_int>`, overrun_behavior\: :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>`\ ) :ref:`🔗<class_TreeItem_method_set_text_overrun_behavior>`
|
||
|
||
設定文字超出專案的邊界矩形時的裁剪行為。所有模式的說明見 :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_set_tooltip_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_tooltip_text**\ (\ column\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TreeItem_method_set_tooltip_text>`
|
||
|
||
設定給定列的工具提示文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_TreeItem_method_uncollapse_tree:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **uncollapse_tree**\ (\ ) :ref:`🔗<class_TreeItem_method_uncollapse_tree>`
|
||
|
||
Uncollapses all **TreeItem**\ s necessary to reveal this **TreeItem**, i.e. all ancestor **TreeItem**\ s.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
|
||
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
|
||
.. |void| replace:: :abbr:`void (無回傳值。)`
|