mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-01-23 15:17:21 +01:00
776 lines
56 KiB
ReStructuredText
776 lines
56 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/TreeItem.xml.
|
|
|
|
.. _class_TreeItem:
|
|
|
|
TreeItem
|
|
========
|
|
|
|
**Inherits:** :ref:`Object<class_Object>`
|
|
|
|
Control for a single item inside a :ref:`Tree<class_Tree>`.
|
|
|
|
Description
|
|
-----------
|
|
|
|
Control for a single item inside a :ref:`Tree<class_Tree>`. May have child ``TreeItem``\ s and be styled as well as contain buttons.
|
|
|
|
You can remove a ``TreeItem`` by using :ref:`Object.free<class_Object_method_free>`.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-------------------------+-----------------------------------------------------------------------------+
|
|
| :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>` |
|
|
+-------------------------+-----------------------------------------------------------------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_button<class_TreeItem_method_add_button>` **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` button, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Variant<class_Variant>` | :ref:`call_recursive<class_TreeItem_method_call_recursive>` **(** :ref:`String<class_String>` method, ... **)** |vararg| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_custom_bg_color<class_TreeItem_method_clear_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_custom_color<class_TreeItem_method_clear_custom_color>` **(** :ref:`int<class_int>` column **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`deselect<class_TreeItem_method_deselect>` **(** :ref:`int<class_int>` column **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`erase_button<class_TreeItem_method_erase_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Texture<class_Texture>` | :ref:`get_button<class_TreeItem_method_get_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_button_by_id<class_TreeItem_method_get_button_by_id>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` id **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_button_count<class_TreeItem_method_get_button_count>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_button_id<class_TreeItem_method_get_button_id>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_button_tooltip<class_TreeItem_method_get_button_tooltip>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` | :ref:`get_cell_mode<class_TreeItem_method_get_cell_mode>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :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>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`get_custom_color<class_TreeItem_method_get_custom_color>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_expand_right<class_TreeItem_method_get_expand_right>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Texture<class_Texture>` | :ref:`get_icon<class_TreeItem_method_get_icon>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_icon_max_width<class_TreeItem_method_get_icon_max_width>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`get_icon_modulate<class_TreeItem_method_get_icon_modulate>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Rect2<class_Rect2>` | :ref:`get_icon_region<class_TreeItem_method_get_icon_region>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Variant<class_Variant>` | :ref:`get_metadata<class_TreeItem_method_get_metadata>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_next<class_TreeItem_method_get_next>` **(** **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_visible<class_TreeItem_method_get_next_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_parent<class_TreeItem_method_get_parent>` **(** **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev<class_TreeItem_method_get_prev>` **(** **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_visible<class_TreeItem_method_get_prev_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_range<class_TreeItem_method_get_range>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_range_config<class_TreeItem_method_get_range_config>` **(** :ref:`int<class_int>` column **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_suffix<class_TreeItem_method_get_suffix>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_text<class_TreeItem_method_get_text>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TextAlign<enum_TreeItem_TextAlign>` | :ref:`get_text_align<class_TreeItem_method_get_text_align>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_tooltip<class_TreeItem_method_get_tooltip>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_button_disabled<class_TreeItem_method_is_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_checked<class_TreeItem_method_is_checked>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_custom_set_as_button<class_TreeItem_method_is_custom_set_as_button>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_editable<class_TreeItem_method_is_editable>` **(** :ref:`int<class_int>` column **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_selectable<class_TreeItem_method_is_selectable>` **(** :ref:`int<class_int>` column **)** |const| |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_selected<class_TreeItem_method_is_selected>` **(** :ref:`int<class_int>` column **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`move_to_bottom<class_TreeItem_method_move_to_bottom>` **(** **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`move_to_top<class_TreeItem_method_move_to_top>` **(** **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_child<class_TreeItem_method_remove_child>` **(** :ref:`Object<class_Object>` child **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`select<class_TreeItem_method_select>` **(** :ref:`int<class_int>` column **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_button<class_TreeItem_method_set_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture<class_Texture>` button **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_button_disabled<class_TreeItem_method_set_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_cell_mode<class_TreeItem_method_set_cell_mode>` **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_checked<class_TreeItem_method_set_checked>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_custom_as_button<class_TreeItem_method_set_custom_as_button>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_custom_bg_color<class_TreeItem_method_set_custom_bg_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_custom_color<class_TreeItem_method_set_custom_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_custom_draw<class_TreeItem_method_set_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`String<class_String>` callback **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_editable<class_TreeItem_method_set_editable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_expand_right<class_TreeItem_method_set_expand_right>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_icon<class_TreeItem_method_set_icon>` **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` texture **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_icon_max_width<class_TreeItem_method_set_icon_max_width>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_icon_modulate<class_TreeItem_method_set_icon_modulate>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_icon_region<class_TreeItem_method_set_icon_region>` **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_metadata<class_TreeItem_method_set_metadata>` **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_range<class_TreeItem_method_set_range>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_range_config<class_TreeItem_method_set_range_config>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step, :ref:`bool<class_bool>` expr=false **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_selectable<class_TreeItem_method_set_selectable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_suffix<class_TreeItem_method_set_suffix>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_text<class_TreeItem_method_set_text>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_text_align<class_TreeItem_method_set_text_align>` **(** :ref:`int<class_int>` column, :ref:`TextAlign<enum_TreeItem_TextAlign>` text_align **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_tooltip<class_TreeItem_method_set_tooltip>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)** |
|
|
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Enumerations
|
|
------------
|
|
|
|
.. _enum_TreeItem_TreeCellMode:
|
|
|
|
.. _class_TreeItem_constant_CELL_MODE_STRING:
|
|
|
|
.. _class_TreeItem_constant_CELL_MODE_CHECK:
|
|
|
|
.. _class_TreeItem_constant_CELL_MODE_RANGE:
|
|
|
|
.. _class_TreeItem_constant_CELL_MODE_ICON:
|
|
|
|
.. _class_TreeItem_constant_CELL_MODE_CUSTOM:
|
|
|
|
enum **TreeCellMode**:
|
|
|
|
- **CELL_MODE_STRING** = **0** --- Cell contains a string.
|
|
|
|
- **CELL_MODE_CHECK** = **1** --- Cell contains a checkbox.
|
|
|
|
- **CELL_MODE_RANGE** = **2** --- Cell contains a range.
|
|
|
|
- **CELL_MODE_ICON** = **3** --- Cell contains an icon.
|
|
|
|
- **CELL_MODE_CUSTOM** = **4**
|
|
|
|
----
|
|
|
|
.. _enum_TreeItem_TextAlign:
|
|
|
|
.. _class_TreeItem_constant_ALIGN_LEFT:
|
|
|
|
.. _class_TreeItem_constant_ALIGN_CENTER:
|
|
|
|
.. _class_TreeItem_constant_ALIGN_RIGHT:
|
|
|
|
enum **TextAlign**:
|
|
|
|
- **ALIGN_LEFT** = **0** --- Align text to the left. See ``set_text_align()``.
|
|
|
|
- **ALIGN_CENTER** = **1** --- Center text. See ``set_text_align()``.
|
|
|
|
- **ALIGN_RIGHT** = **2** --- Align text to the right. See ``set_text_align()``.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_TreeItem_property_collapsed:
|
|
|
|
- :ref:`bool<class_bool>` **collapsed**
|
|
|
|
+----------+----------------------+
|
|
| *Setter* | set_collapsed(value) |
|
|
+----------+----------------------+
|
|
| *Getter* | is_collapsed() |
|
|
+----------+----------------------+
|
|
|
|
If ``true``, the TreeItem is collapsed.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_property_custom_minimum_height:
|
|
|
|
- :ref:`int<class_int>` **custom_minimum_height**
|
|
|
|
+----------+----------------------------------+
|
|
| *Setter* | set_custom_minimum_height(value) |
|
|
+----------+----------------------------------+
|
|
| *Getter* | get_custom_minimum_height() |
|
|
+----------+----------------------------------+
|
|
|
|
The custom minimum height.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_property_disable_folding:
|
|
|
|
- :ref:`bool<class_bool>` **disable_folding**
|
|
|
|
+----------+----------------------------+
|
|
| *Setter* | set_disable_folding(value) |
|
|
+----------+----------------------------+
|
|
| *Getter* | is_folding_disabled() |
|
|
+----------+----------------------------+
|
|
|
|
If ``true``, folding is disabled for this TreeItem.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_TreeItem_method_add_button:
|
|
|
|
- void **add_button** **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` button, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)**
|
|
|
|
Adds a button with :ref:`Texture<class_Texture>` ``button`` at column ``column``. The ``id`` is used to identify the button. 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``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_call_recursive:
|
|
|
|
- :ref:`Variant<class_Variant>` **call_recursive** **(** :ref:`String<class_String>` method, ... **)** |vararg|
|
|
|
|
Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_clear_custom_bg_color:
|
|
|
|
- void **clear_custom_bg_color** **(** :ref:`int<class_int>` column **)**
|
|
|
|
Resets the background color for the given column to default.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_clear_custom_color:
|
|
|
|
- void **clear_custom_color** **(** :ref:`int<class_int>` column **)**
|
|
|
|
Resets the color for the given column to default.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_deselect:
|
|
|
|
- void **deselect** **(** :ref:`int<class_int>` column **)**
|
|
|
|
Deselects the given column.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_erase_button:
|
|
|
|
- void **erase_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)**
|
|
|
|
Removes the button at index ``button_idx`` in column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_button:
|
|
|
|
- :ref:`Texture<class_Texture>` **get_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
|
|
|
|
Returns the :ref:`Texture<class_Texture>` of the button at index ``button_idx`` in column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_button_by_id:
|
|
|
|
- :ref:`int<class_int>` **get_button_by_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` id **)** |const|
|
|
|
|
Returns the button index if there is a button with id ``id`` in column ``column``, otherwise returns -1.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_button_count:
|
|
|
|
- :ref:`int<class_int>` **get_button_count** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the number of buttons in column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_button_id:
|
|
|
|
- :ref:`int<class_int>` **get_button_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
|
|
|
|
Returns the id for the button at index ``button_idx`` in column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_button_tooltip:
|
|
|
|
- :ref:`String<class_String>` **get_button_tooltip** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
|
|
|
|
Returns the tooltip string for the button at index ``button_idx`` in column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_cell_mode:
|
|
|
|
- :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **get_cell_mode** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the column's cell mode.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_children:
|
|
|
|
- :ref:`TreeItem<class_TreeItem>` **get_children** **(** **)**
|
|
|
|
Returns the TreeItem's first child item or a null object if there is none.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_custom_bg_color:
|
|
|
|
- :ref:`Color<class_Color>` **get_custom_bg_color** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the custom background color of column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_custom_color:
|
|
|
|
- :ref:`Color<class_Color>` **get_custom_color** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the custom color of column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_expand_right:
|
|
|
|
- :ref:`bool<class_bool>` **get_expand_right** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns ``true`` if ``expand_right`` is set.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_icon:
|
|
|
|
- :ref:`Texture<class_Texture>` **get_icon** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the given column's icon :ref:`Texture<class_Texture>`. Error if no icon is set.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_icon_max_width:
|
|
|
|
- :ref:`int<class_int>` **get_icon_max_width** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the column's icon's maximum width.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_icon_modulate:
|
|
|
|
- :ref:`Color<class_Color>` **get_icon_modulate** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the :ref:`Color<class_Color>` modulating the column's icon.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_icon_region:
|
|
|
|
- :ref:`Rect2<class_Rect2>` **get_icon_region** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the icon :ref:`Texture<class_Texture>` region as :ref:`Rect2<class_Rect2>`.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_metadata:
|
|
|
|
- :ref:`Variant<class_Variant>` **get_metadata** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the metadata value that was set for the given column using :ref:`set_metadata<class_TreeItem_method_set_metadata>`.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_next:
|
|
|
|
- :ref:`TreeItem<class_TreeItem>` **get_next** **(** **)**
|
|
|
|
Returns the next sibling TreeItem in the tree or a null object if there is none.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_next_visible:
|
|
|
|
- :ref:`TreeItem<class_TreeItem>` **get_next_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
|
|
|
|
Returns the next visible sibling TreeItem in the tree or a null object if there is none.
|
|
|
|
If ``wrap`` is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns ``null``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_parent:
|
|
|
|
- :ref:`TreeItem<class_TreeItem>` **get_parent** **(** **)**
|
|
|
|
Returns the parent TreeItem or a null object if there is none.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_prev:
|
|
|
|
- :ref:`TreeItem<class_TreeItem>` **get_prev** **(** **)**
|
|
|
|
Returns the previous sibling TreeItem in the tree or a null object if there is none.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_prev_visible:
|
|
|
|
- :ref:`TreeItem<class_TreeItem>` **get_prev_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
|
|
|
|
Returns the previous visible sibling TreeItem in the tree or a null object if there is none.
|
|
|
|
If ``wrap`` is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns ``null``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_range:
|
|
|
|
- :ref:`float<class_float>` **get_range** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_range_config:
|
|
|
|
- :ref:`Dictionary<class_Dictionary>` **get_range_config** **(** :ref:`int<class_int>` column **)**
|
|
|
|
Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_suffix:
|
|
|
|
- :ref:`String<class_String>` **get_suffix** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Gets the suffix string shown after the column value.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_text:
|
|
|
|
- :ref:`String<class_String>` **get_text** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the given column's text.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_text_align:
|
|
|
|
- :ref:`TextAlign<enum_TreeItem_TextAlign>` **get_text_align** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the given column's text alignment.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_get_tooltip:
|
|
|
|
- :ref:`String<class_String>` **get_tooltip** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the given column's tooltip.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_is_button_disabled:
|
|
|
|
- :ref:`bool<class_bool>` **is_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
|
|
|
|
Returns ``true`` if the button at index ``button_idx`` for the given column is disabled.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_is_checked:
|
|
|
|
- :ref:`bool<class_bool>` **is_checked** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns ``true`` if the given column is checked.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_is_custom_set_as_button:
|
|
|
|
- :ref:`bool<class_bool>` **is_custom_set_as_button** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_is_editable:
|
|
|
|
- :ref:`bool<class_bool>` **is_editable** **(** :ref:`int<class_int>` column **)**
|
|
|
|
Returns ``true`` if column ``column`` is editable.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_is_selectable:
|
|
|
|
- :ref:`bool<class_bool>` **is_selectable** **(** :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns ``true`` if column ``column`` is selectable.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_is_selected:
|
|
|
|
- :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` column **)**
|
|
|
|
Returns ``true`` if column ``column`` is selected.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_move_to_bottom:
|
|
|
|
- void **move_to_bottom** **(** **)**
|
|
|
|
Moves this TreeItem to the bottom in the :ref:`Tree<class_Tree>` hierarchy.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_move_to_top:
|
|
|
|
- void **move_to_top** **(** **)**
|
|
|
|
Moves this TreeItem to the top in the :ref:`Tree<class_Tree>` hierarchy.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_remove_child:
|
|
|
|
- void **remove_child** **(** :ref:`Object<class_Object>` child **)**
|
|
|
|
Removes the given child ``TreeItem`` and all its children from the :ref:`Tree<class_Tree>`. Note that it doesn't free the item from memory, so it can be reused later. To completely remove a ``TreeItem`` use :ref:`Object.free<class_Object_method_free>`.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_select:
|
|
|
|
- void **select** **(** :ref:`int<class_int>` column **)**
|
|
|
|
Selects the column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_button:
|
|
|
|
- void **set_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture<class_Texture>` button **)**
|
|
|
|
Sets the given column's button :ref:`Texture<class_Texture>` at index ``button_idx`` to ``button``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_button_disabled:
|
|
|
|
- void **set_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)**
|
|
|
|
If ``true``, disables the button at index ``button_idx`` in column ``column``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_cell_mode:
|
|
|
|
- void **set_cell_mode** **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)**
|
|
|
|
Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` constants.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_checked:
|
|
|
|
- void **set_checked** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)**
|
|
|
|
If ``true``, the column ``column`` is checked.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_custom_as_button:
|
|
|
|
- void **set_custom_as_button** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_custom_bg_color:
|
|
|
|
- void **set_custom_bg_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)**
|
|
|
|
Sets the given column's custom background color and whether to just use it as an outline.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_custom_color:
|
|
|
|
- void **set_custom_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)**
|
|
|
|
Sets the given column's custom color.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_custom_draw:
|
|
|
|
- void **set_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`String<class_String>` callback **)**
|
|
|
|
Sets the given column's custom draw callback to ``callback`` method on ``object``.
|
|
|
|
The ``callback`` should accept two arguments: the ``TreeItem`` that is drawn and its position and size as a :ref:`Rect2<class_Rect2>`.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_editable:
|
|
|
|
- void **set_editable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)**
|
|
|
|
If ``true``, column ``column`` is editable.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_expand_right:
|
|
|
|
- void **set_expand_right** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
|
|
|
|
If ``true``, column ``column`` is expanded to the right.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_icon:
|
|
|
|
- void **set_icon** **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` texture **)**
|
|
|
|
Sets the given column's icon :ref:`Texture<class_Texture>`.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_icon_max_width:
|
|
|
|
- void **set_icon_max_width** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)**
|
|
|
|
Sets the given column's icon's maximum width.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_icon_modulate:
|
|
|
|
- void **set_icon_modulate** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)**
|
|
|
|
Modulates the given column's icon with ``modulate``.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_icon_region:
|
|
|
|
- void **set_icon_region** **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)**
|
|
|
|
Sets the given column's icon's texture region.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_metadata:
|
|
|
|
- void **set_metadata** **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)**
|
|
|
|
Sets the metadata value for the given column, which can be retrieved later using :ref:`get_metadata<class_TreeItem_method_get_metadata>`. This can be used, for example, to store a reference to the original data.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_range:
|
|
|
|
- void **set_range** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)**
|
|
|
|
Sets the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_range_config:
|
|
|
|
- void **set_range_config** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step, :ref:`bool<class_bool>` expr=false **)**
|
|
|
|
Sets the range of accepted values for a column. The column must be in the :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode.
|
|
|
|
If ``expr`` is ``true``, the edit mode slider will use an exponential scale as with :ref:`Range.exp_edit<class_Range_property_exp_edit>`.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_selectable:
|
|
|
|
- void **set_selectable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)**
|
|
|
|
If ``true``, the given column is selectable.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_suffix:
|
|
|
|
- void **set_suffix** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
|
|
|
|
Sets a string to be shown after a column's value (for example, a unit abbreviation).
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_text:
|
|
|
|
- void **set_text** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
|
|
|
|
Sets the given column's text value.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_text_align:
|
|
|
|
- void **set_text_align** **(** :ref:`int<class_int>` column, :ref:`TextAlign<enum_TreeItem_TextAlign>` text_align **)**
|
|
|
|
Sets the given column's text alignment. See :ref:`TextAlign<enum_TreeItem_TextAlign>` for possible values.
|
|
|
|
----
|
|
|
|
.. _class_TreeItem_method_set_tooltip:
|
|
|
|
- void **set_tooltip** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)**
|
|
|
|
Sets the given column's tooltip text.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|