Control that provides a list of selectable items (and/or icons) in a single column, or optionally in multiple columns.
This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list.
Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be 'activated' with a double click (or Enter key).
Adds an item to the item list with no text, only an icon.
Adds an item to the item list with specified text. Specify an icon of null for a list item with no icon.
If selectable is [code]true[/code] the list item will be selectable.
Remove all items from the list.
Ensure current selection is visible, adjusting the scroll position as necessary.
Given a position within the control return the item (if any) at that point.
Returns the number of items currently in the list.
Returns the custom background color of the item specified by [code]idx[/code] index. Default value is [code]Color(0, 0, 0, 0)[/code].
Returns the custom foreground color of the item specified by [code]idx[/code] index. Default value is [code]Color(0, 0, 0, 0)[/code].
Returns the icon associated with the specified index. Default value is [code]null[/code]
Returns a [Color] modulating item's icon at the specified index.
Returns the metadata value of the specified index.
Returns the text associated with the specified index.
Returns the tooltip hint associated with the specified index.
Returns an array with the indexes of the selected items.
Returns the [Object] ID associated with the list.
Returns [code]true[/code] if one or more items are selected.
Returns whether or not the item at the specified index is disabled.
Returns whether or not the item at the specified index is selectable.
Returns whether the tooltip is enabled for specified item index.
Returns whether or not item at the specified index is currently selected.
Moves item from index [code]from_idx[/code] to [code]to_idx[/code].
Removes the item specified by [code]idx[/code] index from the list.
Select the item at the specified index.
Note: This method does not trigger the item selection signal.
Sets the background color of the item specified by [code]idx[/code] index to the specified [Color].
[codeblock]
var some_string = "Some text"
some_string.set_item_custom_bg_color(0,Color(1, 0, 0, 1) # This will set the background color of the first item of the control to red.
[/codeblock]
Sets the foreground color of the item specified by [code]idx[/code] index to the specified [Color].
[codeblock]
var some_string = "Some text"
some_string.set_item_custom_fg_color(0,Color(1, 0, 0, 1) # This will set the foreground color of the first item of the control to red.
[/codeblock]
Disable (or enable) item at the specified index.
Disabled items are not be selectable and do not trigger activation (Enter or double-click) signals.
Set (or replace) the icon's [Texture] associated with the specified index.
Sets a modulating [Color] of the item associated with the specified index.
Sets a value (of any type) to be stored with the item associated with the specified index.
Allow or disallow selection of the item associated with the specified index.
Sets text of the item associated with the specified index.
Sets tooltip hint for the item associated with the specified index.
Sets whether the tooltip hint is enabled for specified item index.
Sorts items in the list by their text.
Ensure the item associated with the specified index is not selected.
Ensure there are no items selected.
If [code]true[/code], the currently selected item can be selected again.
If [code]true[/code], right mouse button click can select items.
If [code]true[/code], the control will automatically resize the height to fit its content.
Sets the default column width in pixels.
If left to default value, each item will have a width equal to the width of its content and the columns will have an uneven width.
Sets the default icon size in pixels.
Sets the default position of the icon to either [constant ICON_MODE_LEFT] or [constant ICON_MODE_TOP].
Sets the icon size to its initial size multiplied by the specified scale. Default value is 1.0.
Sets the maximum columns the list will have.
If set to anything other than the default, the content will be split among the specified columns.
If set to [code]true[/code], all columns will have the same width specified by [member fixed_column_width].
Allow single or multiple item selection. See the [enum SelectMode] constants.
Triggered when specified list item is activated via double click or Enter.
Triggered when specified list item has been selected via right mouse clicking.
The click position is also provided to allow appropriate popup of context menus
at the correct location.
[member allow_rmb_select] must be enabled.
Triggered when specified item has been selected.
[member allow_reselect] must be enabled to reselect an item.
Triggered when a multiple selection is altered on a list allowing multiple selection.
Triggered when a left mouse click is issued within the rect of the list but on empty space.
Triggered when a right mouse click is issued within the rect of the list but on empty space.
[member allow_rmb_select] must be enabled.