summaryrefslogtreecommitdiff
path: root/doc/classes/Tree.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Tree.xml')
-rw-r--r--doc/classes/Tree.xml177
1 files changed, 98 insertions, 79 deletions
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index b06be0cf99..02a2789ea5 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -44,12 +44,18 @@
</method>
<method name="create_item">
<return type="TreeItem" />
- <argument index="0" name="parent" type="TreeItem" default="null" />
- <argument index="1" name="idx" type="int" default="-1" />
+ <param index="0" name="parent" type="TreeItem" default="null" />
+ <param index="1" name="index" type="int" default="-1" />
<description>
- Creates an item in the tree and adds it as a child of [code]parent[/code], which can be either a valid [TreeItem] or [code]null[/code].
- If [code]parent[/code] is [code]null[/code], the root item will be the parent, or the new item will be the root itself if the tree is empty.
- The new item will be the [code]idx[/code]th child of parent, or it will be the last child if there are not enough siblings.
+ Creates an item in the tree and adds it as a child of [param parent], which can be either a valid [TreeItem] or [code]null[/code].
+ If [param parent] is [code]null[/code], the root item will be the parent, or the new item will be the root itself if the tree is empty.
+ The new item will be the [param index]-th child of parent, or it will be the last child if there are not enough siblings.
+ </description>
+ </method>
+ <method name="deselect_all">
+ <return type="void" />
+ <description>
+ Deselects all tree items (rows and columns). In [constant SELECT_MULTI] mode also removes selection cursor.
</description>
</method>
<method name="edit_selected">
@@ -68,48 +74,49 @@
</method>
<method name="get_button_id_at_position" qualifiers="const">
<return type="int" />
- <argument index="0" name="position" type="Vector2" />
+ <param index="0" name="position" type="Vector2" />
<description>
- Returns the button id at [code]position[/code], or -1 if no button is there.
+ Returns the button ID at [param position], or -1 if no button is there.
</description>
</method>
<method name="get_column_at_position" qualifiers="const">
<return type="int" />
- <argument index="0" name="position" type="Vector2" />
+ <param index="0" name="position" type="Vector2" />
<description>
- Returns the column index at [code]position[/code], or -1 if no item is there.
+ Returns the column index at [param position], or -1 if no item is there.
</description>
</method>
<method name="get_column_expand_ratio" qualifiers="const">
<return type="int" />
- <argument index="0" name="column" type="int" />
+ <param index="0" name="column" type="int" />
<description>
+ Returns the expand ratio assigned to the column.
</description>
</method>
<method name="get_column_title" qualifiers="const">
<return type="String" />
- <argument index="0" name="column" type="int" />
+ <param index="0" name="column" type="int" />
<description>
Returns the column's title.
</description>
</method>
<method name="get_column_title_direction" qualifiers="const">
<return type="int" enum="Control.TextDirection" />
- <argument index="0" name="column" type="int" />
+ <param index="0" name="column" type="int" />
<description>
Returns column title base writing direction.
</description>
</method>
<method name="get_column_title_language" qualifiers="const">
<return type="String" />
- <argument index="0" name="column" type="int" />
+ <param index="0" name="column" type="int" />
<description>
Returns column title language code.
</description>
</method>
<method name="get_column_width" qualifiers="const">
<return type="int" />
- <argument index="0" name="column" type="int" />
+ <param index="0" name="column" type="int" />
<description>
Returns the column's width in pixels.
</description>
@@ -122,9 +129,9 @@
</method>
<method name="get_drop_section_at_position" qualifiers="const">
<return type="int" />
- <argument index="0" name="position" type="Vector2" />
+ <param index="0" name="position" type="Vector2" />
<description>
- Returns the drop section at [code]position[/code], or -100 if no item is there.
+ Returns the drop section at [param position], or -100 if no item is there.
Values -1, 0, or 1 will be returned for the "above item", "on item", and "below item" drop sections, respectively. See [enum DropModeFlags] for a description of each drop section.
To get the item which the returned drop section is relative to, use [method get_item_at_position].
</description>
@@ -163,26 +170,26 @@
</method>
<method name="get_item_area_rect" qualifiers="const">
<return type="Rect2" />
- <argument index="0" name="item" type="TreeItem" />
- <argument index="1" name="column" type="int" default="-1" />
- <argument index="2" name="button_index" type="int" default="-1" />
+ <param index="0" name="item" type="TreeItem" />
+ <param index="1" name="column" type="int" default="-1" />
+ <param index="2" name="button_index" type="int" default="-1" />
<description>
- Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned.
+ Returns the rectangle area for the specified [TreeItem]. If [param column] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned.
</description>
</method>
<method name="get_item_at_position" qualifiers="const">
<return type="TreeItem" />
- <argument index="0" name="position" type="Vector2" />
+ <param index="0" name="position" type="Vector2" />
<description>
Returns the tree item at the specified position (relative to the tree origin position).
</description>
</method>
<method name="get_next_selected">
<return type="TreeItem" />
- <argument index="0" name="from" type="TreeItem" />
+ <param index="0" name="from" type="TreeItem" />
<description>
Returns the next selected [TreeItem] after the given one, or [code]null[/code] if the end is reached.
- If [code]from[/code] is [code]null[/code], this returns the first selected item.
+ If [param from] is [code]null[/code], this returns the first selected item.
</description>
</method>
<method name="get_pressed_button" qualifiers="const">
@@ -221,78 +228,90 @@
</method>
<method name="is_column_clipping_content" qualifiers="const">
<return type="bool" />
- <argument index="0" name="column" type="int" />
+ <param index="0" name="column" type="int" />
<description>
+ Returns [code]true[/code] if the column has enabled clipping (see [method set_column_clip_content]).
</description>
</method>
<method name="is_column_expanding" qualifiers="const">
<return type="bool" />
- <argument index="0" name="column" type="int" />
+ <param index="0" name="column" type="int" />
<description>
+ Returns [code]true[/code] if the column has enabled expanding (see [method set_column_expand]).
</description>
</method>
<method name="scroll_to_item">
<return type="void" />
- <argument index="0" name="item" type="TreeItem" />
- <argument index="1" name="center_on_item" type="bool" default="false" />
+ <param index="0" name="item" type="TreeItem" />
+ <param index="1" name="center_on_item" type="bool" default="false" />
<description>
Causes the [Tree] to jump to the specified [TreeItem].
</description>
</method>
<method name="set_column_clip_content">
<return type="void" />
- <argument index="0" name="column" type="int" />
- <argument index="1" name="enable" type="bool" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="enable" type="bool" />
<description>
+ Allows to enable clipping for column's content, making the content size ignored.
</description>
</method>
<method name="set_column_custom_minimum_width">
<return type="void" />
- <argument index="0" name="column" type="int" />
- <argument index="1" name="min_width" type="int" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="min_width" type="int" />
<description>
- Overrides the calculated minimum width of a column. It can be set to `0` to restore the default behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio].
+ Overrides the calculated minimum width of a column. It can be set to [code]0[/code] to restore the default behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio].
</description>
</method>
<method name="set_column_expand">
<return type="void" />
- <argument index="0" name="column" type="int" />
- <argument index="1" name="expand" type="bool" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="expand" type="bool" />
<description>
- If [code]true[/code], the column will have the "Expand" flag of [Control]. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio].
+ If [code]true[/code], the column will have the "Expand" flag of [Control]. Columns that have the "Expand" flag will use their expand ratio in a similar fashion to [member Control.size_flags_stretch_ratio] (see [method set_column_expand_ratio]).
</description>
</method>
<method name="set_column_expand_ratio">
<return type="void" />
- <argument index="0" name="column" type="int" />
- <argument index="1" name="ratio" type="int" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="ratio" type="int" />
<description>
+ Sets the relative expand ratio for a column. See [method set_column_expand].
</description>
</method>
<method name="set_column_title">
<return type="void" />
- <argument index="0" name="column" type="int" />
- <argument index="1" name="title" type="String" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="title" type="String" />
<description>
Sets the title of a column.
</description>
</method>
<method name="set_column_title_direction">
<return type="void" />
- <argument index="0" name="column" type="int" />
- <argument index="1" name="direction" type="int" enum="Control.TextDirection" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="direction" type="int" enum="Control.TextDirection" />
<description>
Sets column title base writing direction.
</description>
</method>
<method name="set_column_title_language">
<return type="void" />
- <argument index="0" name="column" type="int" />
- <argument index="1" name="language" type="String" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="language" type="String" />
<description>
Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</description>
</method>
+ <method name="set_selected">
+ <return type="void" />
+ <param index="0" name="item" type="TreeItem" />
+ <param index="1" name="column" type="int" />
+ <description>
+ Selects the specified [TreeItem] and column.
+ </description>
+ </method>
</methods>
<members>
<member name="allow_reselect" type="bool" setter="set_allow_reselect" getter="get_allow_reselect" default="false">
@@ -312,6 +331,9 @@
The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control._can_drop_data] is recommended.
This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position.
</member>
+ <member name="enable_recursive_folding" type="bool" setter="set_enable_recursive_folding" getter="is_recursive_folding_enabled" default="true">
+ If [code]true[/code], recursive folding is enabled for this [Tree]. Holding down Shift while clicking the fold arrow collapses or uncollapses the [TreeItem] and all its descendants.
+ </member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" />
<member name="hide_folding" type="bool" setter="set_hide_folding" getter="is_folding_hidden" default="false">
If [code]true[/code], the folding arrow is hidden.
@@ -331,10 +353,10 @@
</members>
<signals>
<signal name="button_clicked">
- <argument index="0" name="item" type="TreeItem" />
- <argument index="1" name="column" type="int" />
- <argument index="2" name="id" type="int" />
- <argument index="3" name="mouse_button_index" type="int" />
+ <param index="0" name="item" type="TreeItem" />
+ <param index="1" name="column" type="int" />
+ <param index="2" name="id" type="int" />
+ <param index="3" name="mouse_button_index" type="int" />
<description>
Emitted when a button on the tree was pressed (see [method TreeItem.add_button]).
</description>
@@ -345,66 +367,62 @@
</description>
</signal>
<signal name="check_propagated_to_item">
- <argument index="0" name="item" type="TreeItem" />
- <argument index="1" name="column" type="int" />
+ <param index="0" name="item" type="TreeItem" />
+ <param index="1" name="column" type="int" />
<description>
Emitted when [method TreeItem.propagate_check] is called. Connect to this signal to process the items that are affected when [method TreeItem.propagate_check] is invoked. The order that the items affected will be processed is as follows: the item that invoked the method, children of that item, and finally parents of that item.
</description>
</signal>
- <signal name="column_title_pressed">
- <argument index="0" name="column" type="int" />
+ <signal name="column_title_clicked">
+ <param index="0" name="column" type="int" />
+ <param index="1" name="mouse_button_index" type="int" />
<description>
- Emitted when a column's title is pressed.
+ Emitted when a column's title is clicked with either [constant MOUSE_BUTTON_LEFT] or [constant MOUSE_BUTTON_RIGHT].
</description>
</signal>
<signal name="custom_item_clicked">
- <argument index="0" name="mouse_button_index" type="int" />
+ <param index="0" name="mouse_button_index" type="int" />
<description>
Emitted when an item with [constant TreeItem.CELL_MODE_CUSTOM] is clicked with a mouse button.
</description>
</signal>
<signal name="custom_popup_edited">
- <argument index="0" name="arrow_clicked" type="bool" />
+ <param index="0" name="arrow_clicked" type="bool" />
<description>
Emitted when a cell with the [constant TreeItem.CELL_MODE_CUSTOM] is clicked to be edited.
</description>
</signal>
<signal name="empty_clicked">
- <argument index="0" name="position" type="Vector2" />
- <argument index="1" name="mouse_button_index" type="int" />
+ <param index="0" name="position" type="Vector2" />
+ <param index="1" name="mouse_button_index" type="int" />
<description>
Emitted when a mouse button is clicked in the empty space of the tree.
</description>
</signal>
<signal name="item_activated">
<description>
- Emitted when an item's label is double-clicked.
+ Emitted when an item is double-clicked, or selected with a [code]ui_accept[/code] input event (e.g. using [kbd]Enter[/kbd] or [kbd]Space[/kbd] on the keyboard).
</description>
</signal>
<signal name="item_collapsed">
- <argument index="0" name="item" type="TreeItem" />
+ <param index="0" name="item" type="TreeItem" />
<description>
Emitted when an item is collapsed by a click on the folding arrow.
</description>
</signal>
- <signal name="item_custom_button_pressed">
- <description>
- Emitted when a custom button is pressed (i.e. in a [constant TreeItem.CELL_MODE_CUSTOM] mode cell).
- </description>
- </signal>
- <signal name="item_double_clicked">
+ <signal name="item_edited">
<description>
- Emitted when an item's icon is double-clicked.
+ Emitted when an item is edited.
</description>
</signal>
- <signal name="item_edited">
+ <signal name="item_icon_double_clicked">
<description>
- Emitted when an item is edited.
+ Emitted when an item's icon is double-clicked. For a signal that emits when any part of the item is double-clicked, see [signal item_activated].
</description>
</signal>
<signal name="item_mouse_selected">
- <argument index="0" name="position" type="Vector2" />
- <argument index="1" name="mouse_button_index" type="int" />
+ <param index="0" name="position" type="Vector2" />
+ <param index="1" name="mouse_button_index" type="int" />
<description>
Emitted when an item is selected with a mouse button.
</description>
@@ -415,9 +433,9 @@
</description>
</signal>
<signal name="multi_selected">
- <argument index="0" name="item" type="TreeItem" />
- <argument index="1" name="column" type="int" />
- <argument index="2" name="selected" type="bool" />
+ <param index="0" name="item" type="TreeItem" />
+ <param index="1" name="column" type="int" />
+ <param index="2" name="selected" type="bool" />
<description>
Emitted instead of [code]item_selected[/code] if [code]select_mode[/code] is [constant SELECT_MULTI].
</description>
@@ -461,7 +479,7 @@
<theme_item name="custom_button_font_highlight" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
Text [Color] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered.
</theme_item>
- <theme_item name="drop_position_color" data_type="color" type="Color" default="Color(1, 0.3, 0.2, 1)">
+ <theme_item name="drop_position_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
[Color] used to draw possible drop locations. See [enum DropModeFlags] constants for further description of drop locations.
</theme_item>
<theme_item name="font_color" data_type="color" type="Color" default="Color(0.7, 0.7, 0.7, 1)">
@@ -505,6 +523,7 @@
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
+ [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
</theme_item>
<theme_item name="parent_hl_line_margin" data_type="constant" type="int" default="0">
The space between the parent relationship lines for the selected [TreeItem] and the relationship lines to its siblings that are not selected.
@@ -557,12 +576,6 @@
<theme_item name="updown" data_type="icon" type="Texture2D">
The updown arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell.
</theme_item>
- <theme_item name="bg" data_type="style" type="StyleBox">
- Default [StyleBox] for the [Tree], i.e. used when the control is not being focused.
- </theme_item>
- <theme_item name="bg_focus" data_type="style" type="StyleBox">
- [StyleBox] used when the [Tree] is being focused.
- </theme_item>
<theme_item name="button_pressed" data_type="style" type="StyleBox">
[StyleBox] used when a button in the tree is pressed.
</theme_item>
@@ -581,6 +594,12 @@
<theme_item name="custom_button_pressed" data_type="style" type="StyleBox">
[StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's pressed.
</theme_item>
+ <theme_item name="focus" data_type="style" type="StyleBox">
+ The focused style for the [Tree], drawn on top of everything.
+ </theme_item>
+ <theme_item name="panel" data_type="style" type="StyleBox">
+ The background style for the [Tree].
+ </theme_item>
<theme_item name="selected" data_type="style" type="StyleBox">
[StyleBox] for the selected items, used when the [Tree] is not being focused.
</theme_item>