Skip to content

Class: MockCUIListWnd ​

Mock generic list window.

Remarks ​

Item storage is real so that add/remove/selection behaviour can be asserted through the list state rather than through call arguments only. Note that unlike CUIListBox, selection getters return indexes, not items.

Extends ​

Implements ​

  • CUIListWnd

Accessors ​

__name ​

Get Signature ​

ts
get __name(): string;
Returns ​

string

Implementation of ​

ts
CUIListWnd.__name

Inherited from ​

MockCUIWindow.__name


__name ​

Get Signature ​

ts
get static __name(): string;
Returns ​

string

Inherited from ​

MockCUIWindow.__name

Constructors ​

Constructor ​

ts
new MockCUIListWnd(): MockCUIListWnd;

Returns ​

MockCUIListWnd

Inherited from ​

MockCUIWindow.constructor

Methods ​

GetHeight() ​

ts
GetHeight(): number;

Returns ​

number

Window height.

Implementation of ​

ts
CUIListWnd.GetHeight

Inherited from ​

MockCUIWindow.GetHeight


GetWidth() ​

ts
GetWidth(): number;

Returns ​

number

Window width.

Implementation of ​

ts
CUIListWnd.GetWidth

Inherited from ​

MockCUIWindow.GetWidth


OnKeyboard() ​

ts
OnKeyboard(): boolean;

Returns ​

boolean

Inherited from ​

MockCUIWindow.OnKeyboard


Show() ​

ts
Show(isShown: boolean): void;

Show or hide the window.

Parameters ​

ParameterType
isShownboolean

Returns ​

void

Remarks ​

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

Implementation of ​

ts
CUIListWnd.Show

Inherited from ​

MockCUIWindow.Show


create() ​

ts
static create(): MockCUIListWnd;

Returns ​

MockCUIListWnd

Overrides ​

MockCUIWindow.create


mock() ​

ts
static mock(): CUIListWnd;

Returns ​

CUIListWnd

Overrides ​

MockCUIWindow.mock

Properties ​

ActivateList ​

ts
ActivateList: Mock<(flag: boolean) => void>;

Activate or deactivate the list.

Param ​

flag

New active state.

Implementation of ​

ts
CUIListWnd.ActivateList

AddItem ​

ts
AddItem: Mock<(item: CUIListItem) => boolean>;

Add an item and transfer it to the list.

Remarks ​

The Lua binding adopts item; the list owns it after a successful add.

Param ​

item

Item to add.

Returns ​

Whether the item was added.

Implementation of ​

ts
CUIListWnd.AddItem

AttachChild ​

ts
AttachChild: Mock<(window: CUIWindow) => void>;

Attach a child window.

Remarks ​

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

Param ​

child

Child window.

Implementation of ​

ts
CUIListWnd.AttachChild

Inherited from ​

MockCUIWindow.AttachChild


children ​

ts
children: CUIWindow[] = [];

Inherited from ​

MockCUIWindow.children


DetachChild ​

ts
DetachChild: Mock<(window: CUIWindow) => void>;

Detach a child window.

Remarks ​

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

Param ​

child

Child window.

Implementation of ​

ts
CUIListWnd.DetachChild

Inherited from ​

MockCUIWindow.DetachChild


Enable ​

ts
Enable: Mock<(isEnabled: boolean) => void>;

Enable or disable interaction.

Remarks ​

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

Param ​

is_enabled

Whether the window should be enabled.

Implementation of ​

ts
CUIListWnd.Enable

Inherited from ​

MockCUIWindow.Enable


EnableScrollBar ​

ts
EnableScrollBar: Mock<(enable: boolean) => void>;

Enable or disable scrollbar.

Param ​

enable

Whether scrollbar should be enabled.

Implementation of ​

ts
CUIListWnd.EnableScrollBar

focusedIndex ​

ts
focusedIndex: number = -1;

focusReceiveTime ​

ts
focusReceiveTime: number = 0;

Inherited from ​

MockCUIWindow.focusReceiveTime


FocusReceiveTime ​

ts
FocusReceiveTime: Mock<() => number>;

Returns ​

Level time when this window received focus.

Implementation of ​

ts
CUIListWnd.FocusReceiveTime

Inherited from ​

MockCUIWindow.FocusReceiveTime


GetAbsoluteRect ​

ts
GetAbsoluteRect: Mock<() => Frect>;

Returns ​

Window rectangle in screen coordinates.

Implementation of ​

ts
CUIListWnd.GetAbsoluteRect

Inherited from ​

MockCUIWindow.GetAbsoluteRect


GetFocusedItem ​

ts
GetFocusedItem: Mock<() => number>;

Returns ​

Focused item index.

Implementation of ​

ts
CUIListWnd.GetFocusedItem

GetFont ​

ts
GetFont: Mock<() => CGameFont>;

Get the font assigned to this window.

Remarks ​

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

Returns ​

Font assigned to this window.

Implementation of ​

ts
CUIListWnd.GetFont

Inherited from ​

MockCUIWindow.GetFont


GetItem ​

ts
GetItem: Mock<(index: number) => CUIListItem>;

Get an item by index.

Param ​

index

Item index.

Returns ​

List item.

Implementation of ​

ts
CUIListWnd.GetItem

GetItemPos ​

ts
GetItemPos: Mock<(item: CUIListItem) => number>;

Get item index.

Param ​

item

List item.

Returns ​

Item index.

Implementation of ​

ts
CUIListWnd.GetItemPos

GetMouseX ​

ts
GetMouseX: Mock<() => number>;

Get cursor X coordinate stored on this window.

Since ​

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

Source ​

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

Returns ​

Current cursor X coordinate.

Implementation of ​

ts
CUIListWnd.GetMouseX

Inherited from ​

MockCUIWindow.GetMouseX


GetMouseY ​

ts
GetMouseY: Mock<() => number>;

Get cursor Y coordinate stored on this window.

Since ​

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

Source ​

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

Returns ​

Current cursor Y coordinate.

Implementation of ​

ts
CUIListWnd.GetMouseY

Inherited from ​

MockCUIWindow.GetMouseY


GetSelectedItem ​

ts
GetSelectedItem: Mock<() => number>;

Returns ​

Selected item index.

Implementation of ​

ts
CUIListWnd.GetSelectedItem

GetSize ​

ts
GetSize: Mock<() => number>;

Returns ​

Number of items.

Implementation of ​

ts
CUIListWnd.GetSize

GetVertFlip ​

ts
GetVertFlip: Mock<() => boolean>;

Returns ​

Whether vertical flip is enabled.

Implementation of ​

ts
CUIListWnd.GetVertFlip

GetWndPos ​

ts
GetWndPos: Mock<() => vector2>;

Returns ​

Window position relative to its parent.

Implementation of ​

ts
CUIListWnd.GetWndPos

Inherited from ​

MockCUIWindow.GetWndPos


Init ​

ts
Init: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;

Initialize window rectangle.

Param ​

frect

Window rectangle.

Implementation of ​

ts
CUIListWnd.Init

Inherited from ​

MockCUIWindow.Init


isActive ​

ts
isActive: boolean = false;

isAutoDelete ​

ts
isAutoDelete: boolean = false;

Inherited from ​

MockCUIWindow.isAutoDelete


IsAutoDelete ​

ts
IsAutoDelete: Mock<() => boolean>;

Returns ​

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

Implementation of ​

ts
CUIListWnd.IsAutoDelete

Inherited from ​

MockCUIWindow.IsAutoDelete


IsCursorOverWindow ​

ts
IsCursorOverWindow: Mock<() => boolean>;

Returns ​

Whether the UI cursor is currently over this window.

Implementation of ​

ts
CUIListWnd.IsCursorOverWindow

Inherited from ​

MockCUIWindow.IsCursorOverWindow


isEnabled ​

ts
isEnabled: boolean = false;

Inherited from ​

MockCUIWindow.isEnabled


IsEnabled ​

ts
IsEnabled: Mock<() => boolean>;

Returns ​

Whether the window accepts interaction.

Implementation of ​

ts
CUIListWnd.IsEnabled

Inherited from ​

MockCUIWindow.IsEnabled


IsListActive ​

ts
IsListActive: Mock<() => boolean>;

Returns ​

Whether the list is active.

Implementation of ​

ts
CUIListWnd.IsListActive

isPostProcessMode ​

ts
isPostProcessMode: boolean = false;

Inherited from ​

MockCUIWindow.isPostProcessMode


isScrollBarEnabled ​

ts
isScrollBarEnabled: boolean = false;

IsScrollBarEnabled ​

ts
IsScrollBarEnabled: Mock<() => boolean>;

Returns ​

Whether scrollbar is enabled.

Implementation of ​

ts
CUIListWnd.IsScrollBarEnabled

isShown ​

ts
isShown: boolean = false;

Inherited from ​

MockCUIWindow.isShown


IsShown ​

ts
IsShown: Mock<() => boolean>;

Returns ​

Whether the window is visible.

Implementation of ​

ts
CUIListWnd.IsShown

Inherited from ​

MockCUIWindow.IsShown


isVertFlip ​

ts
isVertFlip: boolean = false;

itemHeight ​

ts
itemHeight: number = 0;

items ​

ts
items: CUIListItem[] = [];

mouseX ​

ts
mouseX: number = 0;

Inherited from ​

MockCUIWindow.mouseX


mouseY ​

ts
mouseY: number = 0;

Inherited from ​

MockCUIWindow.mouseY


RemoveAll ​

ts
RemoveAll: Mock<() => void>;

Remove all items.

Implementation of ​

ts
CUIListWnd.RemoveAll

RemoveItem ​

ts
RemoveItem: Mock<(index: number) => void>;

Remove an item by index.

Param ​

index

Item index.

Implementation of ​

ts
CUIListWnd.RemoveItem

ResetFocusCapture ​

ts
ResetFocusCapture: Mock<() => void>;

Release focus capture.

Implementation of ​

ts
CUIListWnd.ResetFocusCapture

ResetPPMode ​

ts
ResetPPMode: Mock<() => void>;

Disable post-process mode for this window.

Remarks ​

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

Implementation of ​

ts
CUIListWnd.ResetPPMode

Inherited from ​

MockCUIWindow.ResetPPMode


ScrollToBegin ​

ts
ScrollToBegin: Mock<UnknownFunction>;

Scroll to the beginning.

Implementation of ​

ts
CUIListWnd.ScrollToBegin

ScrollToEnd ​

ts
ScrollToEnd: Mock<UnknownFunction>;

Scroll to the end.

Implementation of ​

ts
CUIListWnd.ScrollToEnd

ScrollToPos ​

ts
ScrollToPos: Mock<UnknownFunction>;

Scroll to a list position.

Param ​

position

Scroll position.

Implementation of ​

ts
CUIListWnd.ScrollToPos

selectedIndex ​

ts
selectedIndex: number = -1;

SetAutoDelete ​

ts
SetAutoDelete: Mock<(isAutoDelete: boolean) => void>;

Set whether the parent owns this child window.

Remarks ​

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

Param ​

auto_delete

Whether the engine should delete the child automatically.

Implementation of ​

ts
CUIListWnd.SetAutoDelete

Inherited from ​

MockCUIWindow.SetAutoDelete


SetFocusedItem ​

ts
SetFocusedItem: Mock<(index: number) => void>;

Set focused item index.

Param ​

index

Item index.

Implementation of ​

ts
CUIListWnd.SetFocusedItem

SetFont ​

ts
SetFont: Mock<(font: CGameFont) => void>;

Set the font used by this window.

Param ​

font

Font object.

Implementation of ​

ts
CUIListWnd.SetFont

Inherited from ​

MockCUIWindow.SetFont


SetHeight ​

ts
SetHeight: Mock<(height: number) => void>;

Set window height.

Param ​

height

New height.

Implementation of ​

ts
CUIListWnd.SetHeight

Inherited from ​

MockCUIWindow.SetHeight


SetItemHeight ​

ts
SetItemHeight: Mock<(height: number) => void>;

Set list item height.

Param ​

height

Item height.

Implementation of ​

ts
CUIListWnd.SetItemHeight

SetPPMode ​

ts
SetPPMode: Mock<() => void>;

Enable post-process mode for this window.

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.

Implementation of ​

ts
CUIListWnd.SetPPMode

Inherited from ​

MockCUIWindow.SetPPMode


SetTextColor ​

ts
SetTextColor: Mock<(color: number) => void>;

Set text color for list items.

Param ​

color

ARGB color.

Implementation of ​

ts
CUIListWnd.SetTextColor

SetVertFlip ​

ts
SetVertFlip: Mock<(flip: boolean) => void>;

Flip list direction vertically.

Param ​

flip

Whether vertical flip is enabled.

Implementation of ​

ts
CUIListWnd.SetVertFlip

SetWidth ​

ts
SetWidth: Mock<(width: number) => void>;

Set window width.

Param ​

width

New width.

Implementation of ​

ts
CUIListWnd.SetWidth

Inherited from ​

MockCUIWindow.SetWidth


SetWindowName ​

ts
SetWindowName: Mock<(name: string) => void>;

Set debug/window name.

Param ​

name

Window name.

Implementation of ​

ts
CUIListWnd.SetWindowName

Inherited from ​

MockCUIWindow.SetWindowName


SetWndPos ​

ts
SetWndPos: Mock<(positionOrX: number | vector2, y?: number) => void>;

Set window position.

Param ​

vector2

New position.

Implementation of ​

ts
CUIListWnd.SetWndPos

Inherited from ​

MockCUIWindow.SetWndPos


SetWndRect ​

ts
SetWndRect: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;

Set window rectangle.

Param ​

rect

New rectangle.

Implementation of ​

ts
CUIListWnd.SetWndRect

Inherited from ​

MockCUIWindow.SetWndRect


SetWndSize ​

ts
SetWndSize: Mock<(sizeOrWidth: number | vector2, height?: number) => void>;

Set window size.

Param ​

vector2

New size.

Implementation of ​

ts
CUIListWnd.SetWndSize

Inherited from ​

MockCUIWindow.SetWndSize


ShowSelectedItem ​

ts
ShowSelectedItem: Mock<UnknownFunction>;

Scroll the selected item into view.

Param ​

show

Whether selected item should be shown.

Implementation of ​

ts
CUIListWnd.ShowSelectedItem

textColor ​

ts
textColor: number = 0;

windowFont ​

ts
windowFont: CGameFont | null = null;

Inherited from ​

MockCUIWindow.windowFont


windowName ​

ts
windowName: string | null = null;

Inherited from ​

MockCUIWindow.windowName


WindowName ​

ts
WindowName: Mock<() => string>;

Returns ​

Window name.

Implementation of ​

ts
CUIListWnd.WindowName

Inherited from ​

MockCUIWindow.WindowName


windowPosition ​

ts
windowPosition: vector2;

Inherited from ​

MockCUIWindow.windowPosition


windowRect ​

ts
windowRect: Frect | null = null;

Inherited from ​

MockCUIWindow.windowRect


windowSize ​

ts
windowSize: vector2;

Inherited from ​

MockCUIWindow.windowSize