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" by double-clicking them or by pressing Enter.
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 [code]icon[/code], or use [code]null[/code] as the [code]icon[/code] for a list item with no icon.
If selectable is [code]true[/code], the list item will be selectable.
Removes 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.
Returns the custom foreground color of the item specified by [code]idx[/code] index.
Returns the icon associated with the specified index.
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 [code]true[/code] if the item at the specified index is disabled.
Returns [code]true[/code] if the item at the specified index is selectable.
Returns [code]true[/code] if the tooltip is enabled for specified item index.
Returns [code]true[/code] if the 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.
[b]Note:[/b] 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]
Disables (or enables) the item at the specified index.
Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing Enter).
Sets (or replaces) 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.
Allows or disallows selection of the item associated with the specified index.
Sets text of the item associated with the specified index.
Sets the 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.
Ensures the item associated with the specified index is not selected.
Ensures 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.
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].
Allows single or multiple item selection. See the [enum SelectMode] constants.
Triggered when specified list item is activated via double-clicking or by pressing 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.
Only allow selecting a single item.
Allows selecting multiple items by holding Ctrl or Shift.