From b776330cb73672d0faa5e69e56fffe4e94f548f9 Mon Sep 17 00:00:00 2001 From: mhilbrunner Date: Sat, 7 Oct 2017 19:43:24 +0200 Subject: [PATCH] [DOCS] Document Tree --- doc/classes/Tree.xml | 70 ++++++++++++++++++++++------------------ doc/classes/TreeItem.xml | 61 ++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 31 deletions(-) diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 82e85126cc5..bf9245d23a2 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -4,8 +4,8 @@ Control to show a tree of items. - This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structural displaying and interactions. - Trees are built via code, using [TreeItem] objects to create the structure. They have a single root but multiple root can be simulated if a dummy hidden root is added. + This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structured displays and interactions. + Trees are built via code, using [TreeItem] objects to create the structure. They have a single root but multiple roots can be simulated if a dummy hidden root is added. [codeblock] func _ready(): var tree = Tree.new() @@ -26,14 +26,14 @@ - Get whether the column titles are being shown. + Returns [code]true[/code] if the column titles are being shown. - Clear the tree. This erases all of the items. + Clears the tree. This removes all items. @@ -42,27 +42,28 @@ - Create an item in the tree and add it as the last child of [code]parent[/code]. If parent is not given, it will be added as the last child of the root, or it'll the be the root itself if the tree is empty. + Create an item in the tree and add it as the last child of [code]parent[/code]. If parent is not given, it will be added as the root's last child, or it'll the be the root itself if the tree is empty. - Make the current selected item visible. This will scroll the tree to make sure the selected item is in sight. + Makes the currently selected item visible. This will scroll the tree to make sure the selected item is visible. + Returns [code]true[/code] if a cell that is currently already selected may be selected again. - Get whether a right click can select items. + Returns [code]true[/code] if a right click can select items. @@ -71,7 +72,7 @@ - Get the column index under the given point. + Returns the column index under the given point. @@ -80,7 +81,7 @@ - Get the title of the given column. + Returns the column's title. @@ -89,28 +90,28 @@ - Get the width of the given column in pixels. + Returns the column's width in pixels. - Get the amount of columns. + Returns the amount of columns. - Get the rectangle for custom popups. Helper to create custom cell controls that display a popup. See [method TreeItem.set_cell_mode]. + Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See [method TreeItem.set_cell_mode]. - Get the flags of the current drop mode. + Returns the current drop mode's flags. @@ -125,14 +126,14 @@ - Get the current edited item. This is only available for custom cell mode. + Returns the currently edited item. This is only available for custom cell mode. - Get the column of the cell for the current edited icon. This is only available for custom cell mode. + Returns the column for the currently edited item. This is only available for custom cell mode. @@ -143,7 +144,7 @@ - Get the rectangle area of the the specified item. If column is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. + Returns the rectangle area for the specified item. If column is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. @@ -152,7 +153,7 @@ - Get the tree item at the specified position (relative to the tree origin position). + Returns the tree item at the specified position (relative to the tree origin position). @@ -161,49 +162,49 @@ - Get the next selected item after the given one. + Returns the next selected item after the given one. - Get the index of the last pressed button. + Returns the last pressed button's index. - Get the root item of the tree. + Returns the tree's root item. - Get the current scrolling position. + Returns the current scrolling position. - Get the currently selected item. + Returns the currently selected item. - Get the column number of the current selection. + Returns the current selection's column. - Get whether the folding arrow is hidden. + Returns [code]true[/code] if the folding arrow is hidden. @@ -212,6 +213,7 @@ + If [code]true[/code] the currently selected cell may be selected again. @@ -220,7 +222,7 @@ - Set whether or not a right mouse button click can select items. + If [code]true[/code] a right mouse button click can select items. @@ -231,7 +233,7 @@ - Set whether a column will have the "Expand" flag of [Control]. + If [code]true[/code] the column will have the "Expand" flag of [Control]. @@ -262,7 +264,7 @@ - Set whether the column titles visibility. + If [code]true[/code] column titles are visible. @@ -289,7 +291,7 @@ - Set whether the folding arrow should be hidden. + If [code]true[/code] the folding arrow is hidden. @@ -298,7 +300,7 @@ - Set whether the root of the tree should be hidden. + If [code]true[/code] the tree's root is hidden. @@ -307,7 +309,7 @@ - Set the selection mode. Use one of the [code]SELECT_*[/code] constants. + Allow single or multiple selection. See the [code]SELECT_*[/code] constants. @@ -332,6 +334,7 @@ + Emitted when a column's title is pressed. @@ -366,15 +369,17 @@ + Emitted when an item is double clicked. - Emitted when an item is editted. + Emitted when an item is edited. + Emitted when an item is edited using the right mouse button. @@ -397,15 +402,18 @@ + Emitted instead of [code]item_selected[/code] when [code]select_mode[/code] is [code]SELECT_MULTI[/code]. + Allow selection of a single item at a time. + Allow selection of multiple items at the same time. diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index d1e45bd10f5..10ebc72134f 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -1,8 +1,10 @@ + Control for a single item inside a [Tree]. + Control for a single item inside a [Tree]. May have child [TreeItem]\ s and be styled as well as contain buttons. @@ -23,6 +25,7 @@ + Adds a button with [Texture] [code]button[/code] at column [code]column[/code]. The [code]button_idx[/code] index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling [code]get_buton_count()[/code] immediately after this method. Optionally, the button can be [code]disabled[/code] and have a [code]tooltip[/code]. @@ -31,6 +34,7 @@ + Resets the background color for the given column to default. @@ -39,6 +43,7 @@ + Resets the color for the given column to default. @@ -47,6 +52,7 @@ + Deselects the given column. @@ -57,6 +63,7 @@ + Removes the button at index [code]button_idx[/code] in column [code]column[/code]. @@ -67,6 +74,7 @@ + Returns the [Texture] of the button at index [code]button_idx[/code] in column [code]column[/code]. @@ -75,6 +83,7 @@ + Returns the number of buttons in column [code]column[/code]. May be used to get the most recently added button's index, if no index was specified. @@ -83,12 +92,14 @@ + Returns the column's cell mode. See [code]CELL_MODE_*[/code] constants. + Returns the TreeItem's child items. @@ -97,12 +108,14 @@ + Returns the custom background color of column [code]column[/code]. + Returns the custom minimum height. @@ -111,6 +124,7 @@ + Returns [code]true[/code] if [code]expand_right[/code] is set. @@ -119,6 +133,7 @@ + Returns the given column's icon [Texture]. Error if no icon is set. @@ -127,6 +142,7 @@ + Returns the column's icon's maximum width. @@ -135,6 +151,7 @@ + Returns the icon [Texture] region as [Rect2]. @@ -149,30 +166,35 @@ + Returns the next TreeItem in the tree. + Returns the next visible TreeItem in the tree. + Returns the parent TreeItem. + Returns the previous TreeItem in the tree. + Returns the previous visible TreeItem in the tree. @@ -197,6 +219,7 @@ + Returns the given column's text. @@ -205,6 +228,7 @@ + Returns the given column's text alignment. @@ -213,6 +237,7 @@ + Returns the given column's tooltip. @@ -223,6 +248,7 @@ + Returns [code]true[/code] if the button at index [code]button_idx[/code] for the given column is disabled. @@ -231,12 +257,14 @@ + Returns [code]true[/code] if the given column is checked. + Returns [code]true[/code] if this TreeItem is collapsed. @@ -253,12 +281,14 @@ + Returns [code]true[/code] if column [code]column[/code] is editable. + Returns [code]true[/code] if folding is disabled for this TreeItem. @@ -267,6 +297,7 @@ + Returns [code]true[/code] if column [code]column[/code] is selectable. @@ -275,18 +306,21 @@ + Returns [code]true[/code] if column [code]column[/code] is selected. + Moves this TreeItem to the bottom in the [Tree] hierarchy. + Moves this TreeItem to the top in the [Tree] hierarchy. @@ -295,6 +329,7 @@ + Removes the child TreeItem at index [code]index[/code]. @@ -303,6 +338,7 @@ + Selects the column [code]column[/code]. @@ -315,6 +351,7 @@ + Sets the given column's button [Texture] at index [code]button_idx[/code] to [code]button[/code]. @@ -325,6 +362,7 @@ + Sets the given column's cell mode to [code]mode[/code]. See [code]CELL_MODE_*[/code] constants. @@ -335,6 +373,7 @@ + If [code]true[/code] the column [code]column[/code] is checked. @@ -343,6 +382,7 @@ + If [code]true[/code] the TreeItem is collapsed. @@ -365,6 +405,7 @@ + Sets the given column's custom background color and whether to just use it as an outline. @@ -375,6 +416,7 @@ + Sets the given column's custom color. @@ -387,6 +429,7 @@ + Sets the given column's custom draw callback to [code]callback[/code] method on [code]object[/code]. @@ -395,6 +438,7 @@ + Sets the custom minimum height of this TreeItem. @@ -403,6 +447,7 @@ + If [code]true[/code] folding is disabled for this TreeItem. @@ -413,6 +458,7 @@ + If [code]true[/code] column [code]column[/code] is editable. @@ -423,6 +469,7 @@ + If [code]true[/code] column [code]column[/code] is expanded to the right. @@ -433,6 +480,7 @@ + Sets the given column's icon [Texture]. @@ -443,6 +491,7 @@ + Sets the given column's icon's maximum width. @@ -453,6 +502,7 @@ + Sets the given column's icon's texture region. @@ -499,6 +549,7 @@ + If [code]true[/code] the given column is selectable. @@ -519,6 +570,7 @@ + Sets the given column's text alignment. See [code]ALIGN_*[/code] constants. @@ -529,27 +581,36 @@ + Sets the given column's tooltip text. + Cell contains a string. + Cell can be checked. + Cell contains a range. + Cell contains a range expression. + Cell contains an icon. + Align text to the left. See [code]set_text_align()[/code]. + Center text. See [code]set_text_align()[/code]. + Align text to the right. See [code]set_text_align()[/code].