ItemList

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. Item text only supports single-line strings, newline characters (e.g. \n) in the string won't produce a newline. Text wrapping is enabled in constant ICON_MODE_TOP mode, but column's width is adjusted to fully fit its content by default. You need to set fixedColumnWidth greater than zero to wrap the text.

@GodotBaseClass
struct ItemList {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
IconMode
enum IconMode
SelectMode
enum SelectMode

Functions

_getItems
Array _getItems()
_guiInput
void _guiInput(InputEvent arg0)
_scrollChanged
void _scrollChanged(double arg0)
_setItems
void _setItems(Array arg0)
addIconItem
void addIconItem(Texture icon, bool selectable)

Adds an item to the item list with no text, only an icon.

addItem
void addItem(String text, Texture icon, bool selectable)

Adds an item to the item list with specified text. Specify an icon, or use null as the icon for a list item with no icon. If selectable is true, the list item will be selectable.

clear
void clear()

Removes all items from the list.

ensureCurrentIsVisible
void ensureCurrentIsVisible()

Ensure current selection is visible, adjusting the scroll position as necessary.

getAllowReselect
bool getAllowReselect()
getAllowRmbSelect
bool getAllowRmbSelect()
getFixedColumnWidth
long getFixedColumnWidth()
getFixedIconSize
Vector2 getFixedIconSize()
getIconMode
ItemList.IconMode getIconMode()
getIconScale
double getIconScale()
getItemAtPosition
long getItemAtPosition(Vector2 position, bool exact)

Returns the item index at the given position. When there is no item at that point, -1 will be returned if exact is true, and the closest item index will be returned otherwise.

getItemCount
long getItemCount()

Returns the number of items currently in the list.

getItemCustomBgColor
Color getItemCustomBgColor(long idx)

Returns the custom background color of the item specified by idx index.

getItemCustomFgColor
Color getItemCustomFgColor(long idx)

Returns the custom foreground color of the item specified by idx index.

getItemIcon
Ref!Texture getItemIcon(long idx)

Returns the icon associated with the specified index.

getItemIconModulate
Color getItemIconModulate(long idx)

Returns a Color modulating item's icon at the specified index.

getItemIconRegion
Rect2 getItemIconRegion(long idx)

Returns the region of item's icon used. The whole icon will be used if the region has no area.

getItemMetadata
Variant getItemMetadata(long idx)

Returns the metadata value of the specified index.

getItemText
String getItemText(long idx)

Returns the text associated with the specified index.

getItemTooltip
String getItemTooltip(long idx)

Returns the tooltip hint associated with the specified index.

getMaxColumns
long getMaxColumns()
getMaxTextLines
long getMaxTextLines()
getSelectMode
ItemList.SelectMode getSelectMode()
getSelectedItems
PoolIntArray getSelectedItems()

Returns an array with the indexes of the selected items.

getVScroll
VScrollBar getVScroll()

Returns the GodotObject ID associated with the list.

hasAutoHeight
bool hasAutoHeight()
isAnythingSelected
bool isAnythingSelected()

Returns true if one or more items are selected.

isItemDisabled
bool isItemDisabled(long idx)

Returns true if the item at the specified index is disabled.

isItemIconTransposed
bool isItemIconTransposed(long idx)

Returns true if the item icon will be drawn transposed, i.e. the X and Y axes are swapped.

isItemSelectable
bool isItemSelectable(long idx)

Returns true if the item at the specified index is selectable.

isItemTooltipEnabled
bool isItemTooltipEnabled(long idx)

Returns true if the tooltip is enabled for specified item index.

isSameColumnWidth
bool isSameColumnWidth()
isSelected
bool isSelected(long idx)

Returns true if the item at the specified index is currently selected.

moveItem
void moveItem(long from_idx, long to_idx)

Moves item from index from_idx to to_idx.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(ItemList other)
opEquals
bool opEquals(typeof(null) n)
removeItem
void removeItem(long idx)

Removes the item specified by idx index from the list.

select
void select(long idx, bool single)

Select the item at the specified index. Note: This method does not trigger the item selection signal.

setAllowReselect
void setAllowReselect(bool allow)
setAllowRmbSelect
void setAllowRmbSelect(bool allow)
setAutoHeight
void setAutoHeight(bool enable)
setFixedColumnWidth
void setFixedColumnWidth(long width)
setFixedIconSize
void setFixedIconSize(Vector2 size)
setIconMode
void setIconMode(long mode)
setIconScale
void setIconScale(double scale)
setItemCustomBgColor
void setItemCustomBgColor(long idx, Color custom_bg_color)

Sets the background color of the item specified by idx index to the specified Color.

setItemCustomFgColor
void setItemCustomFgColor(long idx, Color custom_fg_color)

Sets the foreground color of the item specified by idx index to the specified Color.

setItemDisabled
void setItemDisabled(long idx, bool disabled)

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).

setItemIcon
void setItemIcon(long idx, Texture icon)

Sets (or replaces) the icon's Texture associated with the specified index.

setItemIconModulate
void setItemIconModulate(long idx, Color modulate)

Sets a modulating Color of the item associated with the specified index.

setItemIconRegion
void setItemIconRegion(long idx, Rect2 rect)

Sets the region of item's icon used. The whole icon will be used if the region has no area.

setItemIconTransposed
void setItemIconTransposed(long idx, bool transposed)

Sets whether the item icon will be drawn transposed.

setItemMetadata
void setItemMetadata(long idx, VariantArg1 metadata)

Sets a value (of any type) to be stored with the item associated with the specified index.

setItemSelectable
void setItemSelectable(long idx, bool selectable)

Allows or disallows selection of the item associated with the specified index.

setItemText
void setItemText(long idx, String text)

Sets text of the item associated with the specified index.

setItemTooltip
void setItemTooltip(long idx, String tooltip)

Sets the tooltip hint for the item associated with the specified index.

setItemTooltipEnabled
void setItemTooltipEnabled(long idx, bool enable)

Sets whether the tooltip hint is enabled for specified item index.

setMaxColumns
void setMaxColumns(long amount)
setMaxTextLines
void setMaxTextLines(long lines)
setSameColumnWidth
void setSameColumnWidth(bool enable)
setSelectMode
void setSelectMode(long mode)
sortItemsByText
void sortItemsByText()

Sorts items in the list by their text.

toHash
size_t toHash()
unselect
void unselect(long idx)

Ensures the item associated with the specified index is not selected.

unselectAll
void unselectAll()

Ensures there are no items selected.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

allowReselect
bool allowReselect [@property getter]
bool allowReselect [@property setter]

If true, the currently selected item can be selected again.

allowRmbSelect
bool allowRmbSelect [@property getter]
bool allowRmbSelect [@property setter]

If true, right mouse button click can select items.

autoHeight
bool autoHeight [@property getter]
bool autoHeight [@property setter]

If true, the control will automatically resize the height to fit its content.

fixedColumnWidth
long fixedColumnWidth [@property getter]
long fixedColumnWidth [@property setter]

The width all columns will be adjusted to. A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width.

fixedIconSize
Vector2 fixedIconSize [@property getter]
Vector2 fixedIconSize [@property setter]

The size all icons will be adjusted to. If either X or Y component is not greater than zero, icon size won't be affected.

iconMode
ItemList.IconMode iconMode [@property getter]
long iconMode [@property setter]

The icon position, whether above or to the left of the text. See the iconmode constants.

iconScale
double iconScale [@property getter]
double iconScale [@property setter]

The scale of icon applied after fixedIconSize and transposing takes effect.

items
Array items [@property getter]
Array items [@property setter]
maxColumns
long maxColumns [@property getter]
long maxColumns [@property setter]

Maximum columns the list will have. If greater than zero, the content will be split among the specified columns. A value of zero means unlimited columns, i.e. all items will be put in the same row.

maxTextLines
long maxTextLines [@property getter]
long maxTextLines [@property setter]

Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. Note: This property takes effect only when iconMode is constant ICON_MODE_TOP. To make the text wrap, fixedColumnWidth should be greater than zero.

sameColumnWidth
bool sameColumnWidth [@property getter]
bool sameColumnWidth [@property setter]

Whether all columns will have the same width. If true, the width is equal to the largest column width of all columns.

selectMode
ItemList.SelectMode selectMode [@property getter]
long selectMode [@property setter]

Allows single or multiple item selection. See the selectmode constants.

Static functions

_new
ItemList _new()

Construct a new instance of ItemList. Note: use memnew!ItemList instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta