Class: MockCUIListBox<T>
Mock CUI list box.
Extends
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends CUIListBoxItem | CUIListBoxItem |
Implements
CUIListBox<T>
Accessors
__name
Get Signature
get __name(): string;Returns
string
Implementation of
CUIListBox.__nameInherited from
__name
Get Signature
get static __name(): string;Returns
string
Inherited from
Constructors
Constructor
new MockCUIListBox<T>(): MockCUIListBox<T>;Returns
MockCUIListBox<T>
Inherited from
Methods
GetHeight()
GetHeight(): number;Returns
number
Window height.
Implementation of
CUIListBox.GetHeightInherited from
GetWidth()
GetWidth(): number;Returns
number
Window width.
Implementation of
CUIListBox.GetWidthInherited from
OnKeyboard()
OnKeyboard(): boolean;Returns
boolean
Inherited from
Show()
Show(isShown: boolean): void;Show or hide the window.
Parameters
| Parameter | Type |
|---|---|
isShown | boolean |
Returns
void
Remarks
Visibility does not attach, detach, enable, or disable the window.
Implementation of
CUIListBox.ShowInherited from
create()
static create(): MockCUIListBox;Returns
MockCUIListBox
Overrides
mock()
static mock(): CUIListBox;Returns
CUIListBox
Overrides
Properties
AddExistingItem
AddExistingItem: Mock<(item: T) => void>;Add an existing item and transfer it to the list.
Remarks
The Lua binding adopts item; keep future lifetime management with the list.
Param
item
Item to add.
Implementation of
CUIListBox.AddExistingItemAddTextItem
AddTextItem: Mock<(text: string) => T>;Add a text item.
Param
text
Item text.
Returns
Created item.
Implementation of
CUIListBox.AddTextItemAddWindow
AddWindow: Mock<UnknownFunction>;Add a window to the scroll view.
Param
window
Window to add.
Param
value
Whether layout should be recalculated.
Implementation of
CUIListBox.AddWindowInherited from
AttachChild
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
CUIListBox.AttachChildInherited from
children
children: CUIWindow[] = [];Inherited from
Clear
Clear: Mock<UnknownFunction>;Remove all child windows.
Implementation of
CUIListBox.ClearInherited from
DetachChild
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
CUIListBox.DetachChildInherited from
Enable
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
CUIListBox.EnableInherited from
focusReceiveTime
focusReceiveTime: number = 0;Inherited from
MockCUIScrollView.focusReceiveTime
FocusReceiveTime
FocusReceiveTime: Mock<() => number>;Returns
Level time when this window received focus.
Implementation of
CUIListBox.FocusReceiveTimeInherited from
MockCUIScrollView.FocusReceiveTime
GetAbsoluteRect
GetAbsoluteRect: Mock<() => Frect>;Returns
Window rectangle in screen coordinates.
Implementation of
CUIListBox.GetAbsoluteRectInherited from
MockCUIScrollView.GetAbsoluteRect
GetCurrentScrollPos
GetCurrentScrollPos: Mock<() => number>;Returns
Current scroll position.
Implementation of
CUIListBox.GetCurrentScrollPosInherited from
MockCUIScrollView.GetCurrentScrollPos
GetFont
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
CUIListBox.GetFontInherited from
GetItem
GetItem: Mock<(index: number) => CUIWindow>;Get item window by index.
Param
index
Item index.
Returns
Item window.
Implementation of
CUIListBox.GetItemGetItemByIndex
GetItemByIndex: Mock<(index: number) => T>;Get typed item by index.
Param
index
Item index.
Returns
List box item.
Implementation of
CUIListBox.GetItemByIndexGetItemHeight
GetItemHeight: Mock<() => number>;Returns
List item height.
Implementation of
CUIListBox.GetItemHeightGetMaxScrollPos
GetMaxScrollPos: Mock<() => number>;Returns
Maximum scroll position.
Implementation of
CUIListBox.GetMaxScrollPosInherited from
MockCUIScrollView.GetMaxScrollPos
GetMinScrollPos
GetMinScrollPos: Mock<() => number>;Returns
Minimum scroll position.
Implementation of
CUIListBox.GetMinScrollPosInherited from
MockCUIScrollView.GetMinScrollPos
GetMouseX
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
CUIListBox.GetMouseXInherited from
GetMouseY
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
CUIListBox.GetMouseYInherited from
GetSelectedIndex
GetSelectedIndex: Mock<() => number>;Returns
Selected item index.
Implementation of
CUIListBox.GetSelectedIndexGetSelectedItem
GetSelectedItem: Mock<() => T>;Returns
Selected item, or null when nothing is selected.
Implementation of
CUIListBox.GetSelectedItemGetSize
GetSize: Mock<() => number>;Returns
Number of items in the list.
Implementation of
CUIListBox.GetSizeGetWndPos
GetWndPos: Mock<() => vector2>;Returns
Window position relative to its parent.
Implementation of
CUIListBox.GetWndPosInherited from
Init
Init: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;Initialize window rectangle.
Param
frect
Window rectangle.
Implementation of
CUIListBox.InitInherited from
isAutoDelete
isAutoDelete: boolean = false;Inherited from
MockCUIScrollView.isAutoDelete
IsAutoDelete
IsAutoDelete: Mock<() => boolean>;Returns
Whether the engine owns and deletes this window with its parent.
Implementation of
CUIListBox.IsAutoDeleteInherited from
MockCUIScrollView.IsAutoDelete
IsCursorOverWindow
IsCursorOverWindow: Mock<() => boolean>;Returns
Whether the UI cursor is currently over this window.
Implementation of
CUIListBox.IsCursorOverWindowInherited from
MockCUIScrollView.IsCursorOverWindow
isEnabled
isEnabled: boolean = false;Inherited from
IsEnabled
IsEnabled: Mock<() => boolean>;Returns
Whether the window accepts interaction.
Implementation of
CUIListBox.IsEnabledInherited from
isFixedScrollBar
isFixedScrollBar: boolean = false;Inherited from
MockCUIScrollView.isFixedScrollBar
isPostProcessMode
isPostProcessMode: boolean = false;Inherited from
MockCUIScrollView.isPostProcessMode
isShown
isShown: boolean = false;Inherited from
IsShown
IsShown: Mock<() => boolean>;Returns
Whether the window is visible.
Implementation of
CUIListBox.IsShownInherited from
itemHeight
itemHeight: number = 0;items
items: T[] = [];maxScrollPosition
maxScrollPosition: number = 0;Inherited from
MockCUIScrollView.maxScrollPosition
minScrollPosition
minScrollPosition: number = 0;Inherited from
MockCUIScrollView.minScrollPosition
mouseX
mouseX: number = 0;Inherited from
mouseY
mouseY: number = 0;Inherited from
RemoveAll
RemoveAll: Mock<() => void>;Remove all items.
Implementation of
CUIListBox.RemoveAllRemoveItem
RemoveItem: Mock<(window: CUIWindow) => void>;Remove an item window.
Param
window
Item window.
Implementation of
CUIListBox.RemoveItemRemoveWindow
RemoveWindow: Mock<UnknownFunction>;Remove a child window from the scroll view.
Param
window
Window to remove.
Implementation of
CUIListBox.RemoveWindowInherited from
MockCUIScrollView.RemoveWindow
ResetPPMode
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
CUIListBox.ResetPPModeInherited from
scrollPosition
scrollPosition: number = 0;Inherited from
MockCUIScrollView.scrollPosition
ScrollToBegin
ScrollToBegin: Mock<() => void>;Scroll to the beginning.
Implementation of
CUIListBox.ScrollToBeginInherited from
MockCUIScrollView.ScrollToBegin
ScrollToEnd
ScrollToEnd: Mock<() => void>;Scroll to the end.
Implementation of
CUIListBox.ScrollToEndInherited from
selectedIndex
selectedIndex: number = 0;SetAutoDelete
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
CUIListBox.SetAutoDeleteInherited from
MockCUIScrollView.SetAutoDelete
SetFixedScrollBar
SetFixedScrollBar: Mock<(fixed: boolean) => void>;Keep scrollbar visibility fixed.
Param
fixed
Whether scrollbar state is fixed.
Implementation of
CUIListBox.SetFixedScrollBarInherited from
MockCUIScrollView.SetFixedScrollBar
SetFont
SetFont: Mock<(font: CGameFont) => void>;Set the font used by this window.
Param
font
Font object.
Implementation of
CUIListBox.SetFontInherited from
SetHeight
SetHeight: Mock<(height: number) => void>;Set window height.
Param
height
New height.
Implementation of
CUIListBox.SetHeightInherited from
SetItemHeight
SetItemHeight: Mock<(height: number) => void>;Set list item height.
Param
height
Item height.
Implementation of
CUIListBox.SetItemHeightSetPPMode
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
CUIListBox.SetPPModeInherited from
SetScrollPos
SetScrollPos: Mock<(position: number) => void>;Set scroll position.
Param
position
Scroll position.
Implementation of
CUIListBox.SetScrollPosInherited from
MockCUIScrollView.SetScrollPos
SetSelectedIndex
SetSelectedIndex: Mock<(index: number) => void>;Select an item by index.
Param
index
Item index.
Implementation of
CUIListBox.SetSelectedIndexSetWidth
SetWidth: Mock<(width: number) => void>;Set window width.
Param
width
New width.
Implementation of
CUIListBox.SetWidthInherited from
SetWindowName
SetWindowName: Mock<(name: string) => void>;Set debug/window name.
Param
name
Window name.
Implementation of
CUIListBox.SetWindowNameInherited from
MockCUIScrollView.SetWindowName
SetWndPos
SetWndPos: Mock<(positionOrX: number | vector2, y?: number) => void>;Set window position.
Param
vector2
New position.
Implementation of
CUIListBox.SetWndPosInherited from
SetWndRect
SetWndRect: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;Set window rectangle.
Param
rect
New rectangle.
Implementation of
CUIListBox.SetWndRectInherited from
SetWndSize
SetWndSize: Mock<(sizeOrWidth: number | vector2, height?: number) => void>;Set window size.
Param
vector2
New size.
Implementation of
CUIListBox.SetWndSizeInherited from
ShowSelectedItem
ShowSelectedItem: Mock<UnknownFunction>;Scroll the selected item into view.
Param
value
Whether selected item should be shown.
Implementation of
CUIListBox.ShowSelectedItemwindowFont
windowFont: CGameFont | null = null;Inherited from
windowName
windowName: string | null = null;Inherited from
WindowName
WindowName: Mock<() => string>;Returns
Window name.
Implementation of
CUIListBox.WindowNameInherited from
windowPosition
windowPosition: vector2;Inherited from
MockCUIScrollView.windowPosition
windowRect
windowRect: Frect | null = null;Inherited from
windowSize
windowSize: vector2;