ItemList¶
Inherits: Control < CanvasItem < Node < Object
Category: Core
Brief Description¶
Control that provides a list of selectable items (and/or icons) in a single column, or optionally in multiple columns.
Member Functions¶
Signals¶
- item_activated ( int index )
Fired when specified list item is activated via double click or Enter.
Fired 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.
- item_selected ( int index )
Fired when specified item has been selected.
Fired when a multiple selection is altered on a list allowing mutliple selection.
Numeric Constants¶
- ICON_MODE_TOP = 0
- ICON_MODE_LEFT = 1
- SELECT_SINGLE = 0
- SELECT_MULTI = 1
Description¶
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).
Member Function Description¶
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 true the list item will be selectable.
- void clear ( )
Remove all items from the list.
- void ensure_current_is_visible ( )
Ensure selection is visible, adjusting the scroll position as necessary.
- bool get_allow_rmb_select ( ) const
Return whether or not items may be selected via right mouse clicking.
- int get_fixed_column_width ( ) const
If column size has been fixed to a value, return that value.
- Vector2 get_fixed_icon_size ( ) const
- int get_icon_mode ( ) const
- float get_icon_scale ( ) const
Given a position within the control return the item (if any) at that point.
- int get_item_count ( ) const
Return count of items currently in the item list.
Return the text for specified item index.
Return tooltip hint for specified item index.
- int get_max_columns ( ) const
Return total number of columns in use by the list.
- int get_max_text_lines ( ) const
Return total number of lines currently in use by the list.
- int get_select_mode ( ) const
- PoolIntArray get_selected_items ( )
Returns the list of selected indexes.
- Object get_v_scroll ( )
Returns the current vertical scroll bar for the List.
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 tooptip is enabled for specified item index.
- bool is_same_column_width ( ) const
Returns whether or not all columns of the list are of the same size.
Returns whether or not item at the specified index is currently selected.
- void remove_item ( int idx )
Remove item at specified index from the list.
Select the item at the specified index.
Note: This method does not trigger the item selection signal.
- void set_allow_rmb_select ( bool allow )
Allow (or disallow) selection of (selectable) items in the list using right mouse button.
- void set_auto_height ( bool enable )
- void set_fixed_column_width ( int width )
Set the size (width) all columns in the list are to use.
- void set_fixed_icon_size ( Vector2 size )
- void set_icon_mode ( int mode )
- void set_icon_scale ( float scale )
Disable (or enable) item at specified index.
Disabled items are not be selectable and do not fire activation (Enter or double-click) signals.
Set (or replace) icon of the item at the specified index.
Sets a value (of any type) to be stored with the item at the specified index.
Allow or disallow selection of the item at the specified index.
Sets text of item at specified index.
Sets tooltip hint for item at specified index.
Sets whether the tooltip is enabled for specified item index.
- void set_max_columns ( int amount )
Set maximum number of columns to use for the list.
- void set_max_text_lines ( int lines )
Set maximum number of lines to use for the list.
- void set_same_column_width ( bool enable )
Sets a fixed size (width) to use for all columns of the list.
- void set_select_mode ( int mode )
- void sort_items_by_text ( )
Sorts items in the list by their text.
- void unselect ( int idx )
Ensure item at specified index is not selected.