From 374299c6fb7248c1bae08fcc0ba7f0467c980f7e Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 8 Feb 2022 23:56:13 +0800 Subject: Improve TreeItem button API --- doc/classes/Tree.xml | 7 +++++++ doc/classes/TreeItem.xml | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 4b051c4938..35a70ae53f 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -72,6 +72,13 @@ [b]Note:[/b] Despite the name of this method, the focus cursor itself is only visible in [constant SELECT_MULTI] mode. + + + + + Returns the button id at [code]position[/code], or -1 if no button is there. + + diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 12c91cdd10..675c534e7b 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -14,11 +14,11 @@ - + - Adds a button with [Texture2D] [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 [method get_button_count] immediately after this method. Optionally, the button can be [code]disabled[/code] and have a [code]tooltip[/code]. + Adds a button with [Texture2D] [code]button[/code] at column [code]column[/code]. The [code]id[/code] is used to identify the button. If not specified, the next available index is used, which may be retrieved by calling [method get_button_count] immediately after this method. Optionally, the button can be [code]disabled[/code] and have a [code]tooltip[/code]. @@ -80,6 +80,14 @@ Returns the [Texture2D] of the button at index [code]button_idx[/code] in column [code]column[/code]. + + + + + + Returns the button index if there is a button with id [code]id[/code] in column [code]column[/code], otherwise returns -1. + + @@ -87,6 +95,14 @@ 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. + + + + + + Returns the id for the button at index [code]button_idx[/code] in column [code]column[/code]. + + -- cgit v1.2.3