Skip to content

Class: CUIListBox<T>

UI binding for CUIListBox.

Source

C++ class CUIListBox : CUIScrollView

Custom Constructor

CUIListBox

Remarks

Items added through the script binding are owned by the list. Selection getters can return no item.

Extends

Type Parameters

Type ParameterDefault type
T extends CUIListBoxItemCUIListBoxItem

Constructors

Constructor

ts
new CUIListBox<T>(): CUIListBox<T>;

Create an empty UI window.

Returns

CUIListBox<T>

Inherited from

CUIScrollView.constructor

Methods

AddExistingItem()

ts
AddExistingItem(item: T): void;

Add an existing item and transfer it to the list.

Parameters

ParameterTypeDescription
itemTItem to add.

Returns

void

Remarks

The Lua binding adopts item; keep future lifetime management with the list.


AddTextItem()

ts
AddTextItem(text: string): T;

Add a text item.

Parameters

ParameterTypeDescription
textstringItem text.

Returns

T

Created item.


AddWindow()

ts
AddWindow(window: CUIWindow, value: boolean): void;

Add a window to the scroll view.

Parameters

ParameterTypeDescription
windowCUIWindowWindow to add.
valuebooleanWhether layout should be recalculated.

Returns

void

Inherited from

CUIScrollView.AddWindow


AttachChild()

ts
AttachChild(child: CUIWindow): void;

Attach a child window.

Parameters

ParameterTypeDescription
childCUIWindowChild window.

Returns

void

Remarks

The Lua binding adopts child; after attachment, treat the parent as owning its lifetime.

Inherited from

CUIScrollView.AttachChild


Clear()

ts
Clear(): void;

Remove all child windows.

Returns

void

Inherited from

CUIScrollView.Clear


DetachChild()

ts
DetachChild(child: CUIWindow): void;

Detach a child window.

Parameters

ParameterTypeDescription
childCUIWindowChild window.

Returns

void

Remarks

Detaching removes the parent relation. It does not reinitialize the window or attach it elsewhere.

Inherited from

CUIScrollView.DetachChild


Enable()

ts
Enable(is_enabled: boolean): void;

Enable or disable interaction.

Parameters

ParameterTypeDescription
is_enabledbooleanWhether the window should be enabled.

Returns

void

Remarks

Enabled state and visibility are separate. Hidden controls can still be enabled.

Inherited from

CUIScrollView.Enable


FocusReceiveTime()

ts
FocusReceiveTime(): number;

Returns

number

Level time when this window received focus.

Inherited from

CUIScrollView.FocusReceiveTime


GetAbsoluteRect()

ts
GetAbsoluteRect(): Frect;

Returns

Frect

Window rectangle in screen coordinates.

Inherited from

CUIScrollView.GetAbsoluteRect


GetCurrentScrollPos()

ts
GetCurrentScrollPos(): number;

Returns

number

Current scroll position.

Inherited from

CUIScrollView.GetCurrentScrollPos


GetFont()

ts
GetFont(): CGameFont;

Get the font assigned to this window.

Returns

CGameFont

Font assigned to this window.

Remarks

Text controls need a font assigned before drawing custom text reliably.

Inherited from

CUIScrollView.GetFont


GetHeight()

ts
GetHeight(): number;

Returns

number

Window height.

Inherited from

CUIScrollView.GetHeight


GetItem()

ts
GetItem(index: number): CUIWindow;

Get item window by index.

Parameters

ParameterTypeDescription
indexnumberItem index.

Returns

CUIWindow

Item window.


GetItemByIndex()

ts
GetItemByIndex(index: number): T;

Get typed item by index.

Parameters

ParameterTypeDescription
indexnumberItem index.

Returns

T

List box item.


GetItemHeight()

ts
GetItemHeight(): number;

Returns

number

List item height.


GetMaxScrollPos()

ts
GetMaxScrollPos(): number;

Returns

number

Maximum scroll position.

Inherited from

CUIScrollView.GetMaxScrollPos


GetMinScrollPos()

ts
GetMinScrollPos(): number;

Returns

number

Minimum scroll position.

Inherited from

CUIScrollView.GetMinScrollPos


GetMouseX()

ts
GetMouseX(): number;

Get cursor X coordinate stored on this window.

Returns

number

Current cursor X coordinate.

Since

OpenXRay 2026-01-01, e3b0e3c5, PR #2028

Source

src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseX binding.

Inherited from

CUIScrollView.GetMouseX


GetMouseY()

ts
GetMouseY(): number;

Get cursor Y coordinate stored on this window.

Returns

number

Current cursor Y coordinate.

Since

OpenXRay 2026-01-01, e3b0e3c5, PR #2028

Source

src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseY binding.

Inherited from

CUIScrollView.GetMouseY


GetSelectedIndex()

ts
GetSelectedIndex(): number;

Returns

number

Selected item index.


GetSelectedItem()

ts
GetSelectedItem(): Nullable<T>;

Returns

Nullable<T>

Selected item, or null when nothing is selected.


GetSize()

ts
GetSize(): number;

Returns

number

Number of items in the list.


GetWidth()

ts
GetWidth(): number;

Returns

number

Window width.

Inherited from

CUIScrollView.GetWidth


GetWndPos()

ts
GetWndPos(): vector2;

Returns

vector2

Window position relative to its parent.

Inherited from

CUIScrollView.GetWndPos


Init()

Call Signature

ts
Init(frect: Frect): void;

Initialize window rectangle.

Parameters
ParameterTypeDescription
frectFrectWindow rectangle.
Returns

void

Inherited from

CUIScrollView.Init

Call Signature

ts
Init(
   x1: number, 
   y1: number, 
   x2: number, 
   y2: number): void;

Initialize window rectangle.

Parameters
ParameterTypeDescription
x1numberX position.
y1numberY position.
x2numberWidth.
y2numberHeight.
Returns

void

Remarks

Coordinates are relative to the parent; x2 and y2 are size, not bottom-right coordinates.

Inherited from

CUIScrollView.Init


IsAutoDelete()

ts
IsAutoDelete(): boolean;

Returns

boolean

Whether the engine owns and deletes this window with its parent.

Inherited from

CUIScrollView.IsAutoDelete


IsCursorOverWindow()

ts
IsCursorOverWindow(): boolean;

Returns

boolean

Whether the UI cursor is currently over this window.

Inherited from

CUIScrollView.IsCursorOverWindow


IsEnabled()

ts
IsEnabled(): boolean;

Returns

boolean

Whether the window accepts interaction.

Inherited from

CUIScrollView.IsEnabled


IsShown()

ts
IsShown(): boolean;

Returns

boolean

Whether the window is visible.

Inherited from

CUIScrollView.IsShown


RemoveAll()

ts
RemoveAll(): void;

Remove all items.

Returns

void


RemoveItem()

ts
RemoveItem(window: CUIWindow): void;

Remove an item window.

Parameters

ParameterTypeDescription
windowCUIWindowItem window.

Returns

void


RemoveWindow()

ts
RemoveWindow(window: CUIWindow): void;

Remove a child window from the scroll view.

Parameters

ParameterTypeDescription
windowCUIWindowWindow to remove.

Returns

void

Inherited from

CUIScrollView.RemoveWindow


ResetPPMode()

ts
ResetPPMode(): void;

Disable post-process mode for this window.

Returns

void

Remarks

Pair with CUIWindow.SetPPMode when a window no longer needs post-process rendering.

Inherited from

CUIScrollView.ResetPPMode


ScrollToBegin()

ts
ScrollToBegin(): void;

Scroll to the beginning.

Returns

void

Inherited from

CUIScrollView.ScrollToBegin


ScrollToEnd()

ts
ScrollToEnd(): void;

Scroll to the end.

Returns

void

Inherited from

CUIScrollView.ScrollToEnd


SetAutoDelete()

ts
SetAutoDelete(auto_delete: boolean): void;

Set whether the parent owns this child window.

Parameters

ParameterTypeDescription
auto_deletebooleanWhether the engine should delete the child automatically.

Returns

void

Remarks

Use this for script-created windows that are attached to a parent and should be cleaned up with the UI tree.

Inherited from

CUIScrollView.SetAutoDelete


SetFixedScrollBar()

ts
SetFixedScrollBar(fixed: boolean): void;

Keep scrollbar visibility fixed.

Parameters

ParameterTypeDescription
fixedbooleanWhether scrollbar state is fixed.

Returns

void

Inherited from

CUIScrollView.SetFixedScrollBar


SetFont()

ts
SetFont(font: CGameFont): void;

Set the font used by this window.

Parameters

ParameterTypeDescription
fontCGameFontFont object.

Returns

void

Inherited from

CUIScrollView.SetFont


SetHeight()

ts
SetHeight(height: number): void;

Set window height.

Parameters

ParameterTypeDescription
heightnumberNew height.

Returns

void

Inherited from

CUIScrollView.SetHeight


SetItemHeight()

ts
SetItemHeight(height: number): void;

Set list item height.

Parameters

ParameterTypeDescription
heightnumberItem height.

Returns

void


SetPPMode()

ts
SetPPMode(): void;

Enable post-process mode for this window.

Returns

void

Remarks

Use for windows meant to be drawn through the post-process UI path, and reset it when the window returns to normal UI rendering.

Inherited from

CUIScrollView.SetPPMode


SetScrollPos()

ts
SetScrollPos(position: number): void;

Set scroll position.

Parameters

ParameterTypeDescription
positionnumberScroll position.

Returns

void

Inherited from

CUIScrollView.SetScrollPos


SetSelectedIndex()

ts
SetSelectedIndex(index: number): void;

Select an item by index.

Parameters

ParameterTypeDescription
indexnumberItem index.

Returns

void


SetWidth()

ts
SetWidth(width: number): void;

Set window width.

Parameters

ParameterTypeDescription
widthnumberNew width.

Returns

void

Inherited from

CUIScrollView.SetWidth


SetWindowName()

ts
SetWindowName(name: string): void;

Set debug/window name.

Parameters

ParameterTypeDescription
namestringWindow name.

Returns

void

Inherited from

CUIScrollView.SetWindowName


SetWndPos()

Call Signature

ts
SetWndPos(vector2: vector2): void;

Set window position.

Parameters
ParameterTypeDescription
vector2vector2New position.
Returns

void

Inherited from

CUIScrollView.SetWndPos

Call Signature

ts
SetWndPos(x1: number, y1: number): void;

Set window position.

Parameters
ParameterTypeDescription
x1numberX position.
y1numberY position.
Returns

void

Inherited from

CUIScrollView.SetWndPos


SetWndRect()

Call Signature

ts
SetWndRect(rect: Frect): void;

Set window rectangle.

Parameters
ParameterTypeDescription
rectFrectNew rectangle.
Returns

void

Inherited from

CUIScrollView.SetWndRect

Call Signature

ts
SetWndRect(
   x1: number, 
   y1: number, 
   x2: number, 
   y2: number): void;

Set window rectangle.

Parameters
ParameterTypeDescription
x1numberX position.
y1numberY position.
x2numberWidth.
y2numberHeight.
Returns

void

Remarks

Coordinates are relative to the parent; x2 and y2 are size, not bottom-right coordinates.

Inherited from

CUIScrollView.SetWndRect


SetWndSize()

Call Signature

ts
SetWndSize(vector2: vector2): void;

Set window size.

Parameters
ParameterTypeDescription
vector2vector2New size.
Returns

void

Inherited from

CUIScrollView.SetWndSize

Call Signature

ts
SetWndSize(width: number, height: number): void;

Set window size.

Parameters
ParameterTypeDescription
widthnumberNew width.
heightnumberNew height.
Returns

void

Inherited from

CUIScrollView.SetWndSize


Show()

ts
Show(show: boolean): void;

Show or hide the window.

Parameters

ParameterTypeDescription
showbooleanWhether the window should be visible.

Returns

void

Remarks

Visibility does not attach, detach, enable, or disable the window.

Inherited from

CUIScrollView.Show


ShowSelectedItem()

ts
ShowSelectedItem(value: boolean): void;

Scroll the selected item into view.

Parameters

ParameterTypeDescription
valuebooleanWhether selected item should be shown.

Returns

void


WindowName()

ts
WindowName(): string;

Returns

string

Window name.

Inherited from

CUIScrollView.WindowName

Properties

__name

ts
readonly __name: string;

LuaBind instance constructor name.

Inherited from

CUIScrollView.__name


__name

ts
readonly static __name: string;

LuaBind class constructor name.

Inherited from

CUIScrollView.__name