ItemList
Record list with text, icons and single or multiple selection.
ItemList stores records rather than separate child Controls for every row. AddItem/AddIconItem return the new record’s current index. Adding does not automatically select it. ItemCount includes all records, including disabled and nonselectable ones.
An index is a position in 0…ItemCount-1 rather than a stable ID. MoveItem, RemoveItem and SortItemsByText change positions. Store your own key with SetItemMetadata; resolve its current index by iterating GetItemMetadata after mutations. Do not treat names or translated text as unique IDs. Metadata Array/Dictionary values can be shared containers.
Select(index) defaults to single = true: it replaces the entire selection even in Multi mode. Accumulate with Select(index, false) while SelectMode = Multi or Toggle. Programmatic Select rejects disabled/nonselectable targets. However, disabling an already selected record or clearing its Selectable flag does not deselect it; call Deselect when needed.
Select, Deselect, DeselectAll and structural operations do not emit user-facing ItemSelected/MultiSelected. Explicitly refresh dependent panels after code-driven changes rather than waiting for a signal. ItemClicked reports input, while ItemActivated reports activation, usually double click or ui_accept; neither is equivalent to a selection change.
Changing Multi/Toggle → Single does not normalize selected flags. GetSelectedItems in Single returns only the first even when IsSelected remains true for others. To switch modes, retain the desired ID, call DeselectAll, set the mode and explicitly select the desired record. GetSelectedItems returns a new index array in list order; editing it does not change selection.
Save selected record IDs before removal/sorting. After rebuilding, reset selection with DeselectAll, resolve indices again and restore using Select. This also avoids stale internal current indices being used for keyboard navigation/scrolling. SetItemCount shrinks by discarding the tail without a selection notification.
SortItemsByText compares original strings rather than localized display or a custom natural order. For your own order, sort the model and rebuild the list. GetItemText returns original text; SetItemLanguage controls shaping, SetItemAutoTranslateMode controls per-record translation. Neither rewrites the original string.
SetItemText and the reviewed SetItem* methods accept negative indices from the end (-1 is last). This is not a general rule for getters, Select, RemoveItem or MoveItem: use ordinary valid indices there. Configure tooltips with SetItemTooltip; disabling SetItemTooltipEnabled retains the string while preventing display.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
ItemListConstructor
public ItemList();Creates an empty list: Single, no selection, AllowReselect/AllowRmbSelect off, AllowSearch on.
Properties18
AllowReselectProperty
public bool AllowReselect { get; set; }Allows repeated user single-selection notification, default false. Does not make direct Select emit ItemSelected.
AllowRmbSelectProperty
public bool AllowRmbSelect { get; set; }Allows right-button selection, default false. Does not create a context menu or restrict programmatic Select.
AllowSearchProperty
public bool AllowSearch { get; set; }Allows incremental typed search in the focused list, default true. Does not filter the model or add a search field.
AutoHeightProperty
public bool AutoHeight { get; set; }Use content height as minimum height, default false. Not automatic scrolling to the last item; depends on columns and is calculated during layout refresh.
AutoWidthProperty
public bool AutoWidth { get; set; }Use content width as Control minimum width, default false. After recalculation can expand the parent container and bypass ordinary width-fitting of columns. Leave false for a bounded list.
FixedColumnWidthProperty
public int FixedColumnWidth { get; set; }Configured column/text width in local pixels, default 0 uses content width. Requires ≥ 0. For text wrapping use positive width with IconMode.Top and MaxTextLines; theme item spacing contributes separately.
FixedIconSizeProperty
public Vector2I FixedIconSize { get; set; }Fixed icon slot; default Vector2I.Zero uses source-region size. Applies when both components are positive; slot is multiplied by IconScale and drawing fits preserving aspect. Does not modify the resource.
IconModeProperty
public ItemList.IconModeEnum IconMode { get; set; }Main icon Left by default or Top. Top permits a wrapped label under bounded width; does not change original text or icon pixels.
IconScaleProperty
public float IconScale { get; set; }Icon drawing/layout size multiplier, default 1. Must be finite; use a positive value for normal display. Also scales FixedIconSize without modifying Texture2D.
ItemCountProperty
public int ItemCount { get; set; }Record count, default 0. Setter requires ≥ 0: new records are empty, selectable and unselected; shrinking discards the tail without selection signals. Reset/restore selection explicitly after structural changes.
MaxColumnsProperty
public int MaxColumns { get; set; }Column-count upper bound, default 1. 0 means no configured cap rather than zero columns. Wrapping can reduce actual count to fit available width. Requires ≥ 0.
MaxTextLinesProperty
public int MaxTextLines { get; set; }Maximum label lines, default 1; requires ≥ 1. Wrapping applies in IconMode.Top and requires bounded width, such as FixedColumnWidth. Increasing it in Left does not enable multiline layout.
SameColumnWidthProperty
public bool SameColumnWidth { get; set; }Equalizes widths using the widest item, default false. Does not fix column count or itself constrain text width.
ScrollHintModeProperty
public ItemList.ScrollHintModeEnum ScrollHintMode { get; set; }Decorative vertical-scroll hint: default Disabled, Both/Top/Bottom. Uses the theme scroll_hint and current range; does not enable scrolling or replace ScrollBar.
SelectModeProperty
public ItemList.SelectModeEnum SelectMode { get; set; }Selection mode, default Single, Multi or Toggle. Toggle switches selection by clicking without Ctrl. Setter does not normalize existing selected flags; for Multi/Toggle → Single call DeselectAll first and restore the desired record.
TextOverrunBehaviorProperty
public TextServer.OverrunBehavior TextOverrunBehavior { get; set; }Text trimming/ellipsis under bounded width, default TrimEllipsis. Does not itself set width or enable wrapping; coordinate with FixedColumnWidth, MaxTextLines and IconMode.
TileScrollHintProperty
public bool TileScrollHint { get; set; }Tile the scroll_hint texture instead of stretching, default false. Relevant when ScrollHintMode is enabled and more content exists above/below.
WraparoundItemsProperty
public bool WraparoundItems { get; set; }Wrap items into following rows to fit width, default true. This is layout rather than cyclic keyboard selection. false allows horizontal overflow; MaxColumns still limits row length.
Methods85
AddIconItemint
public int AddIconItem(Texture2D icon, bool selectable = true);Adds a record with a shared icon and empty text, returning its index. selectable controls selection eligibility; adding does not select it.
| Name | Type | Default |
|---|---|---|
icon | Texture2D | — |
selectable | bool | true |
iconAdds a record with a shared icon and empty text, returning its index. selectable controls selection eligibility; adding does not select it.
selectableAdds a record with a shared icon and empty text, returning its index. selectable controls selection eligibility; adding does not select it.
intNew current icon-record index.
AddItemint
public int AddItem(string text, Texture2D icon = null, bool selectable = true);Appends text, an optional shared icon and selectable flag; returns the new index. Does not automatically change selection or emit ItemSelected.
| Name | Type | Default |
|---|---|---|
text | string | — |
icon | Texture2D | null |
selectable | bool | true |
textAppends text, an optional shared icon and selectable flag; returns the new index. Does not automatically change selection or emit ItemSelected.
iconAppends text, an optional shared icon and selectable flag; returns the new index. Does not automatically change selection or emit ItemSelected.
selectableAppends text, an optional shared icon and selectable flag; returns the new index. Does not automatically change selection or emit ItemSelected.
intNew current record index.
CenterOnCurrentvoid
public void CenterOnCurrent(bool centerVerically = true, bool centerHorizontally = true);Centers the internal current item on requested axes through ScrollBar.Value. Refresh layout first; at least one flag must be true. Does nothing without a valid current; range bounds limit centering near edges.
| Name | Type | Default |
|---|---|---|
centerVerically | bool | true |
centerHorizontally | bool | true |
centerVericallyCenter vertically; the SDK parameter spelling is preserved.
centerHorizontallyCenter horizontally; at least one axis must be enabled.
Clearvoid
public void Clear();Removes all records and resets selection/internal current index. Does not emit ItemSelected/MultiSelected; explicitly refresh dependent panels.
Deselectvoid
public void Deselect(int idx);Clears the specified record’s selected flag without selection signals. In Single also resets the internal current index, so pass the actual selected record; use DeselectAll for a full reset.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
DeselectAllvoid
public void DeselectAll();Clears all selected flags and resets internal current index without ItemSelected/MultiSelected. Useful before mode changes or restoring selection after rebuilding.
EnsureCurrentIsVisiblevoid
public void EnsureCurrentIsVisible();Requests deferred reveal of the internal current item during drawing rather than every selected Multi/Toggle record. Does not change selection. Establish size/records and a current item with single Select first; restore selection after structural changes.
ForceUpdateListSizevoid
public void ForceUpdateListSize();Recalculates list geometry, scroll ranges and auto minimums immediately when layout is dirty. Call after populating/resizing before GetItemRect/geometry queries. Not a forced full redraw or reset of every cache.
GetAllowReselectbool
public bool GetAllowReselect();Allows repeated user single-selection notification, default false. Does not make direct Select emit ItemSelected.
boolRepeated selection-notification flag.
GetAllowRmbSelectbool
public bool GetAllowRmbSelect();Allows right-button selection, default false. Does not create a context menu or restrict programmatic Select.
boolRight-button selection flag.
GetAllowSearchbool
public bool GetAllowSearch();Allows incremental typed search in the focused list, default true. Does not filter the model or add a search field.
boolIncremental typed-search flag.
GetFixedColumnWidthint
public int GetFixedColumnWidth();Configured column/text width in local pixels, default 0 uses content width. Requires ≥ 0. For text wrapping use positive width with IconMode.Top and MaxTextLines; theme item spacing contributes separately.
intConfigured pixel width, 0 for content-based.
GetFixedIconSizeVector2I
public Vector2I GetFixedIconSize();Fixed icon slot; default Vector2I.Zero uses source-region size. Applies when both components are positive; slot is multiplied by IconScale and drawing fits preserving aspect. Does not modify the resource.
Vector2IConfigured Vector2I slot before IconScale.
GetHScrollBarHScrollBar
public HScrollBar GetHScrollBar();Shared internal HScrollBar. Do not free/remove it; horizontal overflow is associated with WraparoundItems = false. RTL direction/range can differ from LTR.
HScrollBarShared internal HScrollBar.
GetIconModeItemList.IconModeEnum
public ItemList.IconModeEnum GetIconMode();Main icon Left by default or Top. Top permits a wrapped label under bounded width; does not change original text or icon pixels.
ItemList.IconModeEnumIconModeEnum.Top or Left.
GetIconScalefloat
public float GetIconScale();Icon drawing/layout size multiplier, default 1. Must be finite; use a positive value for normal display. Also scales FixedIconSize without modifying Texture2D.
floatStored icon sizing multiplier.
GetItemAtPositionint
public int GetItemAtPosition(Vector2 position, bool exact = false);Queries an ItemList-local position, accounting for margins, scrolling and RTL. exact = true requires a hit; false can return the nearest record outside it. The last column can have an extended hit area. Disabled/nonselectable records can match; check flags separately.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
exact | bool | false |
positionPoint in ItemList control-local coordinates.
exacttrue for hits only; false permits nearest items outside their area.
intMatched/nearest record index, or -1.
GetItemAutoTranslateModeEntity.AutoTranslateModeEnum
public Entity.AutoTranslateModeEnum GetItemAutoTranslateMode(int idx);Stored per-record translation mode.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
Entity.AutoTranslateModeEnumRecord AutoTranslateModeEnum.
GetItemCountint
public int GetItemCount();Record count, default 0. Setter requires ≥ 0: new records are empty, selectable and unselected; shrinking discards the tail without selection signals. Reset/restore selection explicitly after structural changes.
intRecord count.
GetItemCustomBgColorColor
public Color GetItemCustomBgColor(int idx);Stored custom background color/alpha.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
ColorBackground color/alpha.
GetItemCustomFgColorColor
public Color GetItemCustomFgColor(int idx);Stored text color; (0, 0, 0, 1) means use the theme rather than necessarily draw black.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
ColorText color, or sentinel (0, 0, 0, 1).
GetItemIconTexture2D
public Texture2D GetItemIcon(int idx);Shared icon Texture2D, or null; source dimensions need not equal the drawing slot.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
Texture2DShared Texture2D, or null.
GetItemIconModulateColor
public Color GetItemIconModulate(int idx);Stored icon color/alpha multiplier.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
ColorIcon color/alpha multiplier.
GetItemIconRegionRect2
public Rect2 GetItemIconRegion(int idx);Stored source Rect2 rather than final screen area.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
Rect2Stored source-region Rect2.
GetItemLanguagestring
public string GetItemLanguage(int idx);Stored shaping language, or empty for the control locale.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
stringShaping language code, or empty.
GetItemMetadataVariant
public Variant GetItemMetadata(int idx);Returns metadata Variant, Nil when unassigned. Use an expected ID type and an ordinary valid index; nested containers can remain shared.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
VariantMetadata Variant, or Nil.
GetItemRectRect2
public Rect2 GetItemRect(int idx, bool expand = true);Cached item rectangle in content coordinates with panel margins, without subtracting scroll or applying screen transforms. In RTL also do not treat it as a ready screen rectangle. expand can extend the last column. Call ForceUpdateListSize after changes before reading.
| Name | Type | Default |
|---|---|---|
idx | int | — |
expand | bool | true |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
expandExtend the last-column rectangle to available width.
Rect2Cached content Rect2 with margins, without scrolling.
GetItemTextstring
public string GetItemText(int idx);Returns the original string rather than translated display.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
stringOriginal record string.
GetItemTextDirectionControl.TextDirection
public Control.TextDirection GetItemTextDirection(int idx);Stored text direction, default Inherited.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
Control.TextDirectionRecord Control.TextDirection.
GetItemTooltipstring
public string GetItemTooltip(int idx);Returns the assigned tooltip string even when display is disabled.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
stringStored tooltip string.
GetMaxColumnsint
public int GetMaxColumns();Column-count upper bound, default 1. 0 means no configured cap rather than zero columns. Wrapping can reduce actual count to fit available width. Requires ≥ 0.
intColumn-count cap, 0 for uncapped.
GetMaxTextLinesint
public int GetMaxTextLines();Maximum label lines, default 1; requires ≥ 1. Wrapping applies in IconMode.Top and requires bounded width, such as FixedColumnWidth. Increasing it in Left does not enable multiline layout.
intLabel line limit, ≥ 1.
GetScrollHintModeItemList.ScrollHintModeEnum
public ItemList.ScrollHintModeEnum GetScrollHintMode();Decorative vertical-scroll hint: default Disabled, Both/Top/Bottom. Uses the theme scroll_hint and current range; does not enable scrolling or replace ScrollBar.
ItemList.ScrollHintModeEnumCurrent ScrollHintModeEnum.
GetSelectModeItemList.SelectModeEnum
public ItemList.SelectModeEnum GetSelectMode();Selection mode, default Single, Multi or Toggle. Toggle switches selection by clicking without Ctrl. Setter does not normalize existing selected flags; for Multi/Toggle → Single call DeselectAll first and restore the desired record.
ItemList.SelectModeEnumCurrent SelectModeEnum.
GetSelectedItemsint[]
public int[] GetSelectedItems();New array of selected indices in list order. In Single stops at the first flag even if others remain after a mode change. Editing the array does not mutate the list.
int[]New int[] of selected indices in list order.
GetTextOverrunBehaviorTextServer.OverrunBehavior
public TextServer.OverrunBehavior GetTextOverrunBehavior();Text trimming/ellipsis under bounded width, default TrimEllipsis. Does not itself set width or enable wrapping; coordinate with FixedColumnWidth, MaxTextLines and IconMode.
TextServer.OverrunBehaviorCurrent OverrunBehavior.
GetVScrollBarVScrollBar
public VScrollBar GetVScrollBar();Shared internal VScrollBar owned by ItemList. Do not free/remove it. Scroll through Value; range/page/visibility are managed by list layout.
VScrollBarShared internal VScrollBar.
HasAutoHeightbool
public bool HasAutoHeight();Use content height as minimum height, default false. Not automatic scrolling to the last item; depends on columns and is calculated during layout refresh.
boolContent-based minimum-height flag.
HasAutoWidthbool
public bool HasAutoWidth();Use content width as Control minimum width, default false. After recalculation can expand the parent container and bypass ordinary width-fitting of columns. Leave false for a bounded list.
boolContent-based minimum-width flag.
HasWraparoundItemsbool
public bool HasWraparoundItems();Wrap items into following rows to fit width, default true. This is layout rather than cyclic keyboard selection. false allows horizontal overflow; MaxColumns still limits row length.
boolWidth-based item wrapping flag.
IsAnythingSelectedbool
public bool IsAnythingSelected();Checks for at least one selected flag. Disabled/nonselectable changes do not automatically clear a previously selected flag.
booltrue when any selected flag exists.
IsItemDisabledbool
public bool IsItemDisabled(int idx);Disabled flag rather than selection state.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
boolRecord disabled flag.
IsItemIconTransposedbool
public bool IsItemIconTransposed(int idx);Icon-axis transpose flag.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
boolAxis-transpose flag.
IsItemSelectablebool
public bool IsItemSelectable(int idx);Selectable flag, separate from disabled and selected.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
boolRecord selectable flag.
IsItemTooltipEnabledbool
public bool IsItemTooltipEnabled(int idx);Tooltip permission flag rather than current visibility.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
boolTooltip permission flag.
IsSameColumnWidthbool
public bool IsSameColumnWidth();Equalizes widths using the widest item, default false. Does not fix column count or itself constrain text width.
boolEqual-width flag.
IsScrollHintTiledbool
public bool IsScrollHintTiled();Tile the scroll_hint texture instead of stretching, default false. Relevant when ScrollHintMode is enabled and more content exists above/below.
boolHint-texture tiling flag.
IsSelectedbool
public bool IsSelected(int idx);Returns a record’s selected flag. Can remain true for multiple records after Multi/Toggle → Single until explicitly normalized.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
boolRecord selected flag.
MoveItemvoid
public void MoveItem(int fromIdx, int toIdx);Moves a complete record to final index toIdx; both indices are 0…ItemCount-1, use ItemCount - 1 for the end. Text, metadata and selected move together. No selection signals; explicitly restore current selection by ID after rebuilding.
| Name | Type | Default |
|---|---|---|
fromIdx | int | — |
toIdx | int | — |
fromIdxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
toIdxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
RemoveItemvoid
public void RemoveItem(int idx);Removes a record and shifts later indices without selection signals. Remaining selected flags stay with their records; internal current index is not a reliable ID. Reset/restore selection after removal.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
Selectvoid
public void Select(int idx, bool single = true);Selects an eligible selectable, non-disabled record without ItemSelected/MultiSelected. Default single = true replaces all selection; false accumulates in Multi or Toggle. In Single mode false still performs single selection.
| Name | Type | Default |
|---|---|---|
idx | int | — |
single | bool | true |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
singletrue replaces all selection; false accumulates in Multi or Toggle.
SetAllowReselectvoid
public void SetAllowReselect(bool allow);Allows repeated user single-selection notification, default false. Does not make direct Select emit ItemSelected.
| Name | Type | Default |
|---|---|---|
allow | bool | — |
allowAllows repeated user single-selection notification, default false. Does not make direct Select emit ItemSelected.
SetAllowRmbSelectvoid
public void SetAllowRmbSelect(bool allow);Allows right-button selection, default false. Does not create a context menu or restrict programmatic Select.
| Name | Type | Default |
|---|---|---|
allow | bool | — |
allowAllows right-button selection, default false. Does not create a context menu or restrict programmatic Select.
SetAllowSearchvoid
public void SetAllowSearch(bool allow);Allows incremental typed search in the focused list, default true. Does not filter the model or add a search field.
| Name | Type | Default |
|---|---|---|
allow | bool | — |
allowAllows incremental typed search in the focused list, default true. Does not filter the model or add a search field.
SetAutoHeightvoid
public void SetAutoHeight(bool enable);Use content height as minimum height, default false. Not automatic scrolling to the last item; depends on columns and is calculated during layout refresh.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableUse content height as minimum height, default false. Not automatic scrolling to the last item; depends on columns and is calculated during layout refresh.
SetAutoWidthvoid
public void SetAutoWidth(bool enable);Use content width as Control minimum width, default false. After recalculation can expand the parent container and bypass ordinary width-fitting of columns. Leave false for a bounded list.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableUse content width as Control minimum width, default false. After recalculation can expand the parent container and bypass ordinary width-fitting of columns. Leave false for a bounded list.
SetFixedColumnWidthvoid
public void SetFixedColumnWidth(int width);Configured column/text width in local pixels, default 0 uses content width. Requires ≥ 0. For text wrapping use positive width with IconMode.Top and MaxTextLines; theme item spacing contributes separately.
| Name | Type | Default |
|---|---|---|
width | int | — |
widthConfigured column/text width in local pixels, default 0 uses content width. Requires ≥ 0. For text wrapping use positive width with IconMode.Top and MaxTextLines; theme item spacing contributes separately.
SetFixedIconSizevoid
public void SetFixedIconSize(Vector2I size);Fixed icon slot; default Vector2I.Zero uses source-region size. Applies when both components are positive; slot is multiplied by IconScale and drawing fits preserving aspect. Does not modify the resource.
| Name | Type | Default |
|---|---|---|
size | Vector2I | — |
sizeFixed icon slot; default Vector2I.Zero uses source-region size. Applies when both components are positive; slot is multiplied by IconScale and drawing fits preserving aspect. Does not modify the resource.
SetIconModevoid
public void SetIconMode(ItemList.IconModeEnum mode);Main icon Left by default or Top. Top permits a wrapped label under bounded width; does not change original text or icon pixels.
| Name | Type | Default |
|---|---|---|
mode | ItemList.IconModeEnum | — |
modeMain icon Left by default or Top. Top permits a wrapped label under bounded width; does not change original text or icon pixels.
SetIconScalevoid
public void SetIconScale(float scale);Icon drawing/layout size multiplier, default 1. Must be finite; use a positive value for normal display. Also scales FixedIconSize without modifying Texture2D.
| Name | Type | Default |
|---|---|---|
scale | float | — |
scaleIcon drawing/layout size multiplier, default 1. Must be finite; use a positive value for normal display. Also scales FixedIconSize without modifying Texture2D.
SetItemAutoTranslateModevoid
public void SetItemAutoTranslateMode(int idx, Entity.AutoTranslateModeEnum mode);Record translation mode: Inherit uses control policy, Always requests translation, Disabled displays original text. Does not rewrite GetItemText. Supports negative indices.
| Name | Type | Default |
|---|---|---|
idx | int | — |
mode | Entity.AutoTranslateModeEnum | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
modeRecord translation mode: Inherit uses control policy, Always requests translation, Disabled displays original text. Does not rewrite GetItemText. Supports negative indices.
SetItemCountvoid
public void SetItemCount(int count);Record count, default 0. Setter requires ≥ 0: new records are empty, selectable and unselected; shrinking discards the tail without selection signals. Reset/restore selection explicitly after structural changes.
| Name | Type | Default |
|---|---|---|
count | int | — |
countRecord count, default 0. Setter requires ≥ 0: new records are empty, selectable and unselected; shrinking discards the tail without selection signals. Reset/restore selection explicitly after structural changes.
SetItemCustomBgColorvoid
public void SetItemCustomBgColor(int idx, Color customBgColor);Custom record background, default transparent black. Drawn when alpha > 0.001; separate from theme selected/hovered style colors. Supports negative indices.
| Name | Type | Default |
|---|---|---|
idx | int | — |
customBgColor | Color | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
customBgColorCustom record background, default transparent black. Drawn when alpha > 0.001; separate from theme selected/hovered style colors. Supports negative indices.
SetItemCustomFgColorvoid
public void SetItemCustomFgColor(int idx, Color customFgColor);Overrides text color. new Color(0, 0, 0, 1) is the sentinel for theme text colors; do not confuse it with C# new Color(), whose alpha is 0. A custom color takes priority over theme selected/disabled text colors. Supports negative indices.
| Name | Type | Default |
|---|---|---|
idx | int | — |
customFgColor | Color | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
customFgColorOverrides text color. new Color(0, 0, 0, 1) is the sentinel for theme text colors; do not confuse it with C# new Color(), whose alpha is 0. A custom color takes priority over theme selected/disabled text colors. Supports negative indices.
SetItemDisabledvoid
public void SetItemDisabled(int idx, bool disabled);Changes the disabled flag: Select and user selection reject that target. A previously selected record retains selected. Supports negative indexing from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
disabled | bool | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
disabledChanges the disabled flag: Select and user selection reject that target. A previously selected record retains selected. Supports negative indexing from the end.
SetItemIconvoid
public void SetItemIcon(int idx, Texture2D icon);Assigns a shared Texture2D; null removes the icon. Marks layout dirty when the reference changes; does not copy the image. Internal resizing of the same resource does not guarantee geometry recalculation. Supports negative indexing from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
icon | Texture2D | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
iconAssigns a shared Texture2D; null removes the icon. Marks layout dirty when the reference changes; does not copy the image. Internal resizing of the same resource does not guarantee geometry recalculation. Supports negative indexing from the end.
SetItemIconModulatevoid
public void SetItemIconModulate(int idx, Color modulate);Icon color/alpha multiplier, default white. Does not change text color or Texture2D pixels. Supports negative indices.
| Name | Type | Default |
|---|---|---|
idx | int | — |
modulate | Color | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
modulateIcon color/alpha multiplier, default white. Does not change text color or Texture2D pixels. Supports negative indices.
SetItemIconRegionvoid
public void SetItemIconRegion(int idx, Rect2 rect);Source-texture region in pixels. Zero width or height uses whole-texture dimensions. Supply a valid rectangle; affects natural slot size without physically cropping the resource. Supports negative indices.
| Name | Type | Default |
|---|---|---|
idx | int | — |
rect | Rect2 | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
rectSource-texture region in pixels. Zero width or height uses whole-texture dimensions. Supply a valid rectangle; affects natural slot size without physically cropping the resource. Supports negative indices.
SetItemIconTransposedvoid
public void SetItemIconTransposed(int idx, bool transposed);Transposes icon axes for drawing and natural sizing without editing texture data. Combines with IconRegion/FixedIconSize/IconScale. Supports negative indices.
| Name | Type | Default |
|---|---|---|
idx | int | — |
transposed | bool | — |
idxIndex 0…ItemCount-1; SetItem* also accepts a negative index from the end.
transposedTransposes icon axes for drawing and natural sizing without editing texture data. Combines with IconRegion/FixedIconSize/IconScale. Supports negative indices.
SetItemLanguagevoid
public void SetItemLanguage(int idx, string language);Record shaping language; empty uses the control locale. Does not translate original Text. Supports negative indexing from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
language | string | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
languageRecord shaping language; empty uses the control locale. Does not translate original Text. Supports negative indexing from the end.
SetItemMetadatavoid
public void SetItemMetadata(int idx, Variant metadata);Sets record Variant data, such as a stable ID. Array/Dictionary can remain shared; this is not a deep copy. Supports negative indexing from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
metadata | Variant | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
metadataSets record Variant data, such as a stable ID. Array/Dictionary can remain shared; this is not a deep copy. Supports negative indexing from the end.
SetItemSelectablevoid
public void SetItemSelectable(int idx, bool selectable);Allows/disallows future record selection. Does not clear an existing selection; call Deselect separately when needed. Supports a negative index from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
selectable | bool | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
selectableAllows/disallows future record selection. Does not clear an existing selection; call Deselect separately when needed. Supports a negative index from the end.
SetItemTextvoid
public void SetItemText(int idx, string text);Changes original text and refreshes translation/shaping. Does not rewrite index or metadata. Supports negative indexing from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
text | string | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
textChanges original text and refreshes translation/shaping. Does not rewrite index or metadata. Supports negative indexing from the end.
SetItemTextDirectionvoid
public void SetItemTextDirection(int idx, Control.TextDirection direction);Record shaping direction; Inherited uses layout direction. Does not reverse the original string. Supports negative indexing from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
direction | Control.TextDirection | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
directionRecord shaping direction; Inherited uses layout direction. Does not reverse the original string. Supports negative indexing from the end.
SetItemTooltipvoid
public void SetItemTooltip(int idx, string tooltip);Sets a separate tooltip string without changing record text. Supports negative indexing from the end. Use SetItemTooltipEnabled to prevent display.
| Name | Type | Default |
|---|---|---|
idx | int | — |
tooltip | string | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
tooltipSets a separate tooltip string without changing record text. Supports negative indexing from the end. Use SetItemTooltipEnabled to prevent display.
SetItemTooltipEnabledvoid
public void SetItemTooltipEnabled(int idx, bool enable);Allows tooltip display, default true. Disabling does not clear the stored tooltip. Supports negative indexing from the end.
| Name | Type | Default |
|---|---|---|
idx | int | — |
enable | bool | — |
idxIndex 0…ItemCount-1; only the reviewed SetItem* methods accept negative indexing from the end.
enableAllows tooltip display, default true. Disabling does not clear the stored tooltip. Supports negative indexing from the end.
SetMaxColumnsvoid
public void SetMaxColumns(int amount);Column-count upper bound, default 1. 0 means no configured cap rather than zero columns. Wrapping can reduce actual count to fit available width. Requires ≥ 0.
| Name | Type | Default |
|---|---|---|
amount | int | — |
amountColumn-count upper bound, default 1. 0 means no configured cap rather than zero columns. Wrapping can reduce actual count to fit available width. Requires ≥ 0.
SetMaxTextLinesvoid
public void SetMaxTextLines(int lines);Maximum label lines, default 1; requires ≥ 1. Wrapping applies in IconMode.Top and requires bounded width, such as FixedColumnWidth. Increasing it in Left does not enable multiline layout.
| Name | Type | Default |
|---|---|---|
lines | int | — |
linesMaximum label lines, default 1; requires ≥ 1. Wrapping applies in IconMode.Top and requires bounded width, such as FixedColumnWidth. Increasing it in Left does not enable multiline layout.
SetSameColumnWidthvoid
public void SetSameColumnWidth(bool enable);Equalizes widths using the widest item, default false. Does not fix column count or itself constrain text width.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableEqualizes widths using the widest item, default false. Does not fix column count or itself constrain text width.
SetScrollHintModevoid
public void SetScrollHintMode(ItemList.ScrollHintModeEnum scrollHintMode);Decorative vertical-scroll hint: default Disabled, Both/Top/Bottom. Uses the theme scroll_hint and current range; does not enable scrolling or replace ScrollBar.
| Name | Type | Default |
|---|---|---|
scrollHintMode | ItemList.ScrollHintModeEnum | — |
scrollHintModeDecorative vertical-scroll hint: default Disabled, Both/Top/Bottom. Uses the theme scroll_hint and current range; does not enable scrolling or replace ScrollBar.
SetSelectModevoid
public void SetSelectMode(ItemList.SelectModeEnum mode);Selection mode, default Single, Multi or Toggle. Toggle switches selection by clicking without Ctrl. Setter does not normalize existing selected flags; for Multi/Toggle → Single call DeselectAll first and restore the desired record.
| Name | Type | Default |
|---|---|---|
mode | ItemList.SelectModeEnum | — |
modeSelection mode, default Single, Multi or Toggle. Toggle switches selection by clicking without Ctrl. Setter does not normalize existing selected flags; for Multi/Toggle → Single call DeselectAll first and restore the desired record.
SetTextOverrunBehaviorvoid
public void SetTextOverrunBehavior(TextServer.OverrunBehavior overrunBehavior);Text trimming/ellipsis under bounded width, default TrimEllipsis. Does not itself set width or enable wrapping; coordinate with FixedColumnWidth, MaxTextLines and IconMode.
| Name | Type | Default |
|---|---|---|
overrunBehavior | TextServer.OverrunBehavior | — |
overrunBehaviorText trimming/ellipsis under bounded width, default TrimEllipsis. Does not itself set width or enable wrapping; coordinate with FixedColumnWidth, MaxTextLines and IconMode.
SetTileScrollHintvoid
public void SetTileScrollHint(bool tileScrollHint);Tile the scroll_hint texture instead of stretching, default false. Relevant when ScrollHintMode is enabled and more content exists above/below.
| Name | Type | Default |
|---|---|---|
tileScrollHint | bool | — |
tileScrollHintTile the scroll_hint texture instead of stretching, default false. Relevant when ScrollHintMode is enabled and more content exists above/below.
SetWraparoundItemsvoid
public void SetWraparoundItems(bool enable);Wrap items into following rows to fit width, default true. This is layout rather than cyclic keyboard selection. false allows horizontal overflow; MaxColumns still limits row length.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableWrap items into following rows to fit width, default true. This is layout rather than cyclic keyboard selection. false allows horizontal overflow; MaxColumns still limits row length.
SortItemsByTextvoid
public void SortItemsByText();Sorts records by original Text comparison rather than translation or locale-aware natural order. Selected/metadata move with records; do not assume stable ordering of equal strings. Does not emit selection signals.
Signals and events5
EmptyClickedEvent
public event ItemList.EmptyClickedEventHandler EmptyClicked;Click on empty space. Does not itself promise deselection; call DeselectAll in the handler and refresh the panel when that behavior is desired.
| Name | Type | Default |
|---|---|---|
atPosition | Vector2 | — |
mouseButtonIndex | long | — |
atPositionInput position in ItemList local coordinates.
mouseButtonIndexNumeric mouse-button value.
ItemActivatedEvent
public event ItemList.ItemActivatedEventHandler ItemActivated;Record activation, usually double click or ui_accept. Not selection and not emitted by simple Select. Check application-model permission before opening/executing.
| Name | Type | Default |
|---|---|---|
index | long | — |
indexRecord index at event time; read metadata for a stable ID.
ItemClickedEvent
public event ItemList.ItemClickedEventHandler ItemClicked;Record click action; selection may be unchanged. Supplies index, local position and mouse button. For a context menu inspect the button separately from AllowRmbSelect.
| Name | Type | Default |
|---|---|---|
index | long | — |
atPosition | Vector2 | — |
mouseButtonIndex | long | — |
indexRecord index at event time; read metadata for a stable ID.
atPositionInput position in ItemList local coordinates.
mouseButtonIndexNumeric mouse-button value.
ItemSelectedEvent
public event ItemList.ItemSelectedEventHandler ItemSelected;User selection notification in single mode. Direct Select/Deselect/list rebuilding do not emit it. Supplies a current index rather than stable ID.
| Name | Type | Default |
|---|---|---|
index | long | — |
indexRecord index at event time; read metadata for a stable ID.
MultiSelectedEvent
public event ItemList.MultiSelectedEventHandler MultiSelected;User-input selected-flag change in multiple mode. Direct Select/Deselect do not emit it. Range selection can produce multiple events.
| Name | Type | Default |
|---|---|---|
index | long | — |
selected | bool | — |
indexRecord index at event time; read metadata for a stable ID.
selectedNew selected state of this record.
ItemList.IconModeEnum
ItemList.ScrollHintModeEnum
| Value | Description |
|---|---|
Both = 1 | Scroll hints will be shown at the top and bottom. |
Bottom = 3 | Only the bottom scroll hint will be shown. |
Disabled = 0 | Scroll hints will never be shown. |
Top = 2 | Only the top scroll hint will be shown. |
ItemList.SelectModeEnum
| Value | Description |
|---|---|
Multi = 1 | Allows selecting multiple items by holding [kbd]Ctrl[/kbd] or [kbd]Shift[/kbd]. |
Single = 0 | Only allow selecting a single item. |
Toggle = 2 | Allows selecting multiple items by toggling them on and off. |
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
font_colorColor | Default text Color(0.65, 0.65, 0.65, 1) |
font_disabled_colorColor | Text Color(0.875, 0.875, 0.875, 0.5) |
font_disabled_hovered_colorColor | Text Color(0.875, 0.875, 0.875, 0.5) |
font_hovered_colorColor | Text Color(0.95, 0.95, 0.95, 1) |
font_hovered_selected_colorColor | Text Color(1, 1, 1, 1) |
font_outline_colorColor | The tint of text outline of the item. Default:Color(0, 0, 0, 1) |
font_selected_colorColor | Text Color(1, 1, 1, 1) |
guide_colorColor |
Color(0.7, 0.7, 0.7, 0.25) |
scroll_hint_colorColor |
Color(0, 0, 0, 1) |
h_separationint | The horizontal spacing between items. Default:4 |
icon_marginint | The spacing between item's icon and text. Default:4 |
line_separationint | The vertical spacing between each line of text. Default:2 |
outline_sizeint | The size of the item text outline.
Note: If using a font with 0 |
scrollbar_h_separationint | The horizontal separation of items and the vertical scrollbar. Default:4 |
scrollbar_margin_bottomint | The bottom margin of the horizontal scrollbar. When negative, uses -1 |
scrollbar_margin_leftint | The left margin of the horizontal scrollbar. When negative, uses -1 |
scrollbar_margin_rightint | The right margin of the horizontal scrollbar. When negative, uses -1 |
scrollbar_margin_topint | The top margin of the horizontal scrollbar. When negative, uses -1 |
v_separationint | The vertical spacing between items. Default:4 |
fontFont |
|
font_sizeint | Font size of the item's text. |
scroll_hintTexture2D | The indicator that will be shown when the content can still be scrolled. See |
focus_soundAudioStream | Played when this |
item_hovered_soundAudioStream | Played when an item is hovered. Disabled items do not play a hover sound. |
item_selected_disabled_soundAudioStream | Played when selecting a disabled item is attempted. |
item_selected_soundAudioStream | Played when an item is selected. |
cursorStyleBox |
|
cursor_unfocusedStyleBox |
|
disabledStyleBox |
|
disabled_hoveredStyleBox |
|
focusStyleBox | The focused style for the |
hoveredStyleBox |
|
hovered_selectedStyleBox |
|
hovered_selected_focusStyleBox |
|
panelStyleBox | The background style for the |
selectedStyleBox |
|
selected_focusStyleBox |
|