Skip to content

Class: MockCUIComboBox

Mock base window class.

Extends

Implements

  • CUIComboBox

Accessors

__name

Get Signature

ts
get __name(): string;
Returns

string

Implementation of

ts
CUIComboBox.__name

Inherited from

MockCUIWindow.__name


__name

Get Signature

ts
get static __name(): string;
Returns

string

Inherited from

MockCUIWindow.__name

Constructors

Constructor

ts
new MockCUIComboBox(): MockCUIComboBox;

Returns

MockCUIComboBox

Inherited from

MockCUIWindow.constructor

Methods

GetHeight()

ts
GetHeight(): number;

Returns

number

Window height.

Implementation of

ts
CUIComboBox.GetHeight

Inherited from

MockCUIWindow.GetHeight


GetWidth()

ts
GetWidth(): number;

Returns

number

Window width.

Implementation of

ts
CUIComboBox.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
CUIComboBox.Show

Inherited from

MockCUIWindow.Show


create()

ts
static create(): MockCUIComboBox;

Returns

MockCUIComboBox

Overrides

MockCUIWindow.create


mock()

ts
static mock(): CUIComboBox;

Returns

CUIComboBox

Overrides

MockCUIWindow.mock

Properties

AddItem

ts
AddItem: Mock<(label: string, id: number) => void>;

Add an item.

Param

label

Item text.

Param

id

Item id.

Implementation of

ts
CUIComboBox.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
CUIComboBox.AttachChild

Inherited from

MockCUIWindow.AttachChild


children

ts
children: CUIWindow[] = [];

Inherited from

MockCUIWindow.children


ClearList

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

Remove all items from the combo box.

Implementation of

ts
CUIComboBox.ClearList

currentId

ts
currentId: number = 0;

CurrentID

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

Returns

Current item id.

Implementation of

ts
CUIComboBox.CurrentID

currentIndex

ts
currentIndex: number = 0;

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
CUIComboBox.DetachChild

Inherited from

MockCUIWindow.DetachChild


disable_id

ts
disable_id: Mock<(id: number) => void>;

Disable an item by id.

Remarks

id is the item id passed to CUIComboBox.AddItem, not the visual index.

Param

id

Item id.

Implementation of

ts
CUIComboBox.disable_id

disabledItemIds

ts
disabledItemIds: Set<number>;

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
CUIComboBox.Enable

Inherited from

MockCUIWindow.Enable


enable_id

ts
enable_id: Mock<(id: number) => void>;

Enable an item by id.

Remarks

id is the item id passed to CUIComboBox.AddItem, not the visual index.

Param

id

Item id.

Implementation of

ts
CUIComboBox.enable_id

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
CUIComboBox.FocusReceiveTime

Inherited from

MockCUIWindow.FocusReceiveTime


GetAbsoluteRect

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

Returns

Window rectangle in screen coordinates.

Implementation of

ts
CUIComboBox.GetAbsoluteRect

Inherited from

MockCUIWindow.GetAbsoluteRect


GetCurrentIdx

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

Returns

Current selected item index.

Implementation of

ts
CUIComboBox.GetCurrentIdx

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
CUIComboBox.GetFont

Inherited from

MockCUIWindow.GetFont


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
CUIComboBox.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
CUIComboBox.GetMouseY

Inherited from

MockCUIWindow.GetMouseY


GetText

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

Returns

Current visible text.

Implementation of

ts
CUIComboBox.GetText

GetTextOf

ts
GetTextOf: Mock<(id: number) => string>;

Get text for an item id.

Remarks

id is the item id passed to CUIComboBox.AddItem, not the visual index.

Param

id

Item id.

Returns

Item text.

Implementation of

ts
CUIComboBox.GetTextOf

GetWndPos

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

Returns

Window position relative to its parent.

Implementation of

ts
CUIComboBox.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
CUIComboBox.Init

Inherited from

MockCUIWindow.Init


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
CUIComboBox.IsAutoDelete

Inherited from

MockCUIWindow.IsAutoDelete


IsCursorOverWindow

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

Returns

Whether the UI cursor is currently over this window.

Implementation of

ts
CUIComboBox.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
CUIComboBox.IsEnabled

Inherited from

MockCUIWindow.IsEnabled


isPostProcessMode

ts
isPostProcessMode: boolean = false;

Inherited from

MockCUIWindow.isPostProcessMode


isShown

ts
isShown: boolean = false;

Inherited from

MockCUIWindow.isShown


IsShown

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

Returns

Whether the window is visible.

Implementation of

ts
CUIComboBox.IsShown

Inherited from

MockCUIWindow.IsShown


isVertScrollEnabled

ts
isVertScrollEnabled: boolean = false;

items

ts
items: Map<number, string>;

listLength

ts
listLength: number = 0;

mouseX

ts
mouseX: number = 0;

Inherited from

MockCUIWindow.mouseX


mouseY

ts
mouseY: number = 0;

Inherited from

MockCUIWindow.mouseY


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
CUIComboBox.ResetPPMode

Inherited from

MockCUIWindow.ResetPPMode


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
CUIComboBox.SetAutoDelete

Inherited from

MockCUIWindow.SetAutoDelete


SetCurrentID

ts
SetCurrentID: Mock<(id: number) => void>;

Select an item by id.

Remarks

id is the item id passed to CUIComboBox.AddItem, not the visual index.

Param

id

Item id.

Implementation of

ts
CUIComboBox.SetCurrentID

SetCurrentIdx

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

Select an item by index.

Remarks

Index follows current visual order and can change when the list contents change.

Param

index

Item index.

Implementation of

ts
CUIComboBox.SetCurrentIdx

SetCurrentOptValue

ts
SetCurrentOptValue: Mock<UnknownFunction>;

Apply the current option value from engine options.

Implementation of

ts
CUIComboBox.SetCurrentOptValue

SetCurrentValue

ts
SetCurrentValue: Mock<UnknownFunction>;

Apply the current combo value.

Implementation of

ts
CUIComboBox.SetCurrentValue

SetFont

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

Set the font used by this window.

Param

font

Font object.

Implementation of

ts
CUIComboBox.SetFont

Inherited from

MockCUIWindow.SetFont


SetHeight

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

Set window height.

Param

height

New height.

Implementation of

ts
CUIComboBox.SetHeight

Inherited from

MockCUIWindow.SetHeight


SetListLength

ts
SetListLength: Mock<(length: number) => void>;

Set visible list length.

Param

length

Maximum visible item count.

Implementation of

ts
CUIComboBox.SetListLength

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
CUIComboBox.SetPPMode

Inherited from

MockCUIWindow.SetPPMode


SetText

ts
SetText: Mock<(text: string) => void>;

Set the visible text.

Param

text

Text to show.

Implementation of

ts
CUIComboBox.SetText

SetVertScroll

ts
SetVertScroll: Mock<(enabled: boolean) => void>;

Enable or disable the vertical scrollbar.

Param

enabled

Whether vertical scrolling is enabled.

Implementation of

ts
CUIComboBox.SetVertScroll

SetWidth

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

Set window width.

Param

width

New width.

Implementation of

ts
CUIComboBox.SetWidth

Inherited from

MockCUIWindow.SetWidth


SetWindowName

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

Set debug/window name.

Param

name

Window name.

Implementation of

ts
CUIComboBox.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
CUIComboBox.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
CUIComboBox.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
CUIComboBox.SetWndSize

Inherited from

MockCUIWindow.SetWndSize


text

ts
text: string = "";

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