.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_ItemList: ItemList ======== **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`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 ---------------- +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_icon_item` **(** :ref:`Texture` icon, :ref:`bool` selectable=true **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_item` **(** :ref:`String` text, :ref:`Texture` icon=NULL, :ref:`bool` selectable=true **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`ensure_current_is_visible` **(** **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_allow_rmb_select` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_fixed_column_width` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_fixed_icon_size` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_icon_mode` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_icon_scale` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_at_pos` **(** :ref:`Vector2` pos, :ref:`bool` exact=false **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_count` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_item_custom_bg_color` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_item_icon` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_item_icon_region` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`get_item_metadata` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_text` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_tooltip` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_max_columns` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_max_text_lines` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_select_mode` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`IntArray` | :ref:`get_selected_items` **(** **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_v_scroll` **(** **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_disabled` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_selectable` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_tooltip_enabled` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`is_same_column_width` **(** **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selected` **(** :ref:`int` idx **)** const | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_item` **(** :ref:`int` idx **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` idx, :ref:`bool` single=true **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_allow_rmb_select` **(** :ref:`bool` allow **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_fixed_column_width` **(** :ref:`int` width **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_fixed_icon_size` **(** :ref:`Vector2` size **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon_mode` **(** :ref:`int` mode **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon_scale` **(** :ref:`float` scale **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_custom_bg_color` **(** :ref:`int` idx, :ref:`Color` custom_bg_color **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_disabled` **(** :ref:`int` idx, :ref:`bool` disabled **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_icon` **(** :ref:`int` idx, :ref:`Texture` icon **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_icon_region` **(** :ref:`int` idx, :ref:`Rect2` rect **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_metadata` **(** :ref:`int` idx, :ref:`Variant` metadata **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_selectable` **(** :ref:`int` idx, :ref:`bool` selectable **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_text` **(** :ref:`int` idx, :ref:`String` text **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_tooltip` **(** :ref:`int` idx, :ref:`String` tooltip **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_tooltip_enabled` **(** :ref:`int` idx, :ref:`bool` enable **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_max_columns` **(** :ref:`int` amount **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_max_text_lines` **(** :ref:`int` lines **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_same_column_width` **(** :ref:`bool` enable **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_select_mode` **(** :ref:`int` mode **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`sort_items_by_text` **(** **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`unselect` **(** :ref:`int` idx **)** | +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- - **item_activated** **(** :ref:`int` index **)** Fired when specified list item is activated via double click or Enter. - **item_rmb_selected** **(** :ref:`int` index, :ref:`Vector2` atpos **)** 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** **(** :ref:`int` index **)** Fired when specified item has been selected. - **multi_selected** **(** :ref:`int` index, :ref:`bool` 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 --------------------------- .. _class_ItemList_add_icon_item: - void **add_icon_item** **(** :ref:`Texture` icon, :ref:`bool` selectable=null **)** Adds an item to the item list with no text, only an icon. .. _class_ItemList_add_item: - void **add_item** **(** :ref:`String` text, :ref:`Texture` icon=null, :ref:`bool` selectable=null **)** 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. .. _class_ItemList_clear: - void **clear** **(** **)** Remove all items from the list. .. _class_ItemList_ensure_current_is_visible: - void **ensure_current_is_visible** **(** **)** Ensure selection is visible, adjusting the scroll position as necessary. .. _class_ItemList_get_allow_rmb_select: - :ref:`bool` **get_allow_rmb_select** **(** **)** const Return whether or not items may be selected via right mouse clicking. .. _class_ItemList_get_fixed_column_width: - :ref:`int` **get_fixed_column_width** **(** **)** const If column size has been fixed to a value, return that value. .. _class_ItemList_get_fixed_icon_size: - :ref:`Vector2` **get_fixed_icon_size** **(** **)** const .. _class_ItemList_get_icon_mode: - :ref:`int` **get_icon_mode** **(** **)** const .. _class_ItemList_get_icon_scale: - :ref:`float` **get_icon_scale** **(** **)** const .. _class_ItemList_get_item_at_pos: - :ref:`int` **get_item_at_pos** **(** :ref:`Vector2` pos, :ref:`bool` exact=null **)** const Given a position within the control return the item (if any) at that point. .. _class_ItemList_get_item_count: - :ref:`int` **get_item_count** **(** **)** const Return count of items currently in the item list. .. _class_ItemList_get_item_custom_bg_color: - :ref:`Color` **get_item_custom_bg_color** **(** :ref:`int` idx **)** const .. _class_ItemList_get_item_icon: - :ref:`Texture` **get_item_icon** **(** :ref:`int` idx **)** const .. _class_ItemList_get_item_icon_region: - :ref:`Rect2` **get_item_icon_region** **(** :ref:`int` idx **)** const .. _class_ItemList_get_item_metadata: - :ref:`Variant` **get_item_metadata** **(** :ref:`int` idx **)** const .. _class_ItemList_get_item_text: - :ref:`String` **get_item_text** **(** :ref:`int` idx **)** const Return the text for specified item index. .. _class_ItemList_get_item_tooltip: - :ref:`String` **get_item_tooltip** **(** :ref:`int` idx **)** const Return tooltip hint for specified item index. .. _class_ItemList_get_max_columns: - :ref:`int` **get_max_columns** **(** **)** const Return total number of columns in use by the list. .. _class_ItemList_get_max_text_lines: - :ref:`int` **get_max_text_lines** **(** **)** const Return total number of lines currently in use by the list. .. _class_ItemList_get_select_mode: - :ref:`int` **get_select_mode** **(** **)** const .. _class_ItemList_get_selected_items: - :ref:`PoolIntArray` **get_selected_items** **(** **)** Returns the list of selected indexes. .. _class_ItemList_get_v_scroll: - :ref:`Object` **get_v_scroll** **(** **)** Returns the current vertical scroll bar for the List. .. _class_ItemList_is_item_disabled: - :ref:`bool` **is_item_disabled** **(** :ref:`int` idx **)** const Returns whether or not the item at the specified index is disabled .. _class_ItemList_is_item_selectable: - :ref:`bool` **is_item_selectable** **(** :ref:`int` idx **)** const Returns whether or not the item at the specified index is selectable. .. _class_ItemList_is_item_tooltip_enabled: - :ref:`bool` **is_item_tooltip_enabled** **(** :ref:`int` idx **)** const Returns whether the tooptip is enabled for specified item index. .. _class_ItemList_is_same_column_width: - :ref:`bool` **is_same_column_width** **(** **)** const Returns whether or not all columns of the list are of the same size. .. _class_ItemList_is_selected: - :ref:`bool` **is_selected** **(** :ref:`int` idx **)** const Returns whether or not item at the specified index is currently selected. .. _class_ItemList_remove_item: - void **remove_item** **(** :ref:`int` idx **)** Remove item at specified index from the list. .. _class_ItemList_select: - void **select** **(** :ref:`int` idx, :ref:`bool` single=null **)** Select the item at the specified index. Note: This method does not trigger the item selection signal. .. _class_ItemList_set_allow_rmb_select: - void **set_allow_rmb_select** **(** :ref:`bool` allow **)** Allow (or disallow) selection of (selectable) items in the list using right mouse button. .. _class_ItemList_set_auto_height: - void **set_auto_height** **(** :ref:`bool` enable **)** .. _class_ItemList_set_fixed_column_width: - void **set_fixed_column_width** **(** :ref:`int` width **)** Set the size (width) all columns in the list are to use. .. _class_ItemList_set_fixed_icon_size: - void **set_fixed_icon_size** **(** :ref:`Vector2` size **)** .. _class_ItemList_set_icon_mode: - void **set_icon_mode** **(** :ref:`int` mode **)** .. _class_ItemList_set_icon_scale: - void **set_icon_scale** **(** :ref:`float` scale **)** .. _class_ItemList_set_item_custom_bg_color: - void **set_item_custom_bg_color** **(** :ref:`int` idx, :ref:`Color` custom_bg_color **)** .. _class_ItemList_set_item_disabled: - void **set_item_disabled** **(** :ref:`int` idx, :ref:`bool` disabled **)** Disable (or enable) item at specified index. Disabled items are not be selectable and do not fire activation (Enter or double-click) signals. .. _class_ItemList_set_item_icon: - void **set_item_icon** **(** :ref:`int` idx, :ref:`Texture` icon **)** Set (or replace) icon of the item at the specified index. .. _class_ItemList_set_item_icon_region: - void **set_item_icon_region** **(** :ref:`int` idx, :ref:`Rect2` rect **)** .. _class_ItemList_set_item_metadata: - void **set_item_metadata** **(** :ref:`int` idx, :ref:`Variant` metadata **)** Sets a value (of any type) to be stored with the item at the specified index. .. _class_ItemList_set_item_selectable: - void **set_item_selectable** **(** :ref:`int` idx, :ref:`bool` selectable **)** Allow or disallow selection of the item at the specified index. .. _class_ItemList_set_item_text: - void **set_item_text** **(** :ref:`int` idx, :ref:`String` text **)** Sets text of item at specified index. .. _class_ItemList_set_item_tooltip: - void **set_item_tooltip** **(** :ref:`int` idx, :ref:`String` tooltip **)** Sets tooltip hint for item at specified index. .. _class_ItemList_set_item_tooltip_enabled: - void **set_item_tooltip_enabled** **(** :ref:`int` idx, :ref:`bool` enable **)** Sets whether the tooltip is enabled for specified item index. .. _class_ItemList_set_max_columns: - void **set_max_columns** **(** :ref:`int` amount **)** Set maximum number of columns to use for the list. .. _class_ItemList_set_max_text_lines: - void **set_max_text_lines** **(** :ref:`int` lines **)** Set maximum number of lines to use for the list. .. _class_ItemList_set_same_column_width: - void **set_same_column_width** **(** :ref:`bool` enable **)** Sets a fixed size (width) to use for all columns of the list. .. _class_ItemList_set_select_mode: - void **set_select_mode** **(** :ref:`int` mode **)** .. _class_ItemList_sort_items_by_text: - void **sort_items_by_text** **(** **)** Sorts items in the list by their text. .. _class_ItemList_unselect: - void **unselect** **(** :ref:`int` idx **)** Ensure item at specified index is not selected.