Class: MockCUIComboBox
Mock base window class.
Extends
Implements
CUIComboBox
Accessors
__name
Get Signature
get __name(): string;Returns
string
Implementation of
CUIComboBox.__nameInherited from
__name
Get Signature
get static __name(): string;Returns
string
Inherited from
Constructors
Constructor
new MockCUIComboBox(): MockCUIComboBox;Returns
MockCUIComboBox
Inherited from
Methods
GetHeight()
GetHeight(): number;Returns
number
Window height.
Implementation of
CUIComboBox.GetHeightInherited from
GetWidth()
GetWidth(): number;Returns
number
Window width.
Implementation of
CUIComboBox.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
CUIComboBox.ShowInherited from
create()
static create(): MockCUIComboBox;Returns
MockCUIComboBox
Overrides
mock()
static mock(): CUIComboBox;Returns
CUIComboBox
Overrides
Properties
AddItem
AddItem: Mock<(label: string, id: number) => void>;Add an item.
Param
label
Item text.
Param
id
Item id.
Implementation of
CUIComboBox.AddItemAttachChild
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
CUIComboBox.AttachChildInherited from
children
children: CUIWindow[] = [];Inherited from
ClearList
ClearList: Mock<() => void>;Remove all items from the combo box.
Implementation of
CUIComboBox.ClearListcurrentId
currentId: number = 0;CurrentID
CurrentID: Mock<() => number>;Returns
Current item id.
Implementation of
CUIComboBox.CurrentIDcurrentIndex
currentIndex: number = 0;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
CUIComboBox.DetachChildInherited from
disable_id
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
CUIComboBox.disable_iddisabledItemIds
disabledItemIds: Set<number>;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
CUIComboBox.EnableInherited from
enable_id
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
CUIComboBox.enable_idfocusReceiveTime
focusReceiveTime: number = 0;Inherited from
MockCUIWindow.focusReceiveTime
FocusReceiveTime
FocusReceiveTime: Mock<() => number>;Returns
Level time when this window received focus.
Implementation of
CUIComboBox.FocusReceiveTimeInherited from
MockCUIWindow.FocusReceiveTime
GetAbsoluteRect
GetAbsoluteRect: Mock<() => Frect>;Returns
Window rectangle in screen coordinates.
Implementation of
CUIComboBox.GetAbsoluteRectInherited from
GetCurrentIdx
GetCurrentIdx: Mock<() => number>;Returns
Current selected item index.
Implementation of
CUIComboBox.GetCurrentIdxGetFont
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
CUIComboBox.GetFontInherited from
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
CUIComboBox.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
CUIComboBox.GetMouseYInherited from
GetText
GetText: Mock<() => string>;Returns
Current visible text.
Implementation of
CUIComboBox.GetTextGetTextOf
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
CUIComboBox.GetTextOfGetWndPos
GetWndPos: Mock<() => vector2>;Returns
Window position relative to its parent.
Implementation of
CUIComboBox.GetWndPosInherited from
Init
Init: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;Initialize window rectangle.
Param
frect
Window rectangle.
Implementation of
CUIComboBox.InitInherited from
isAutoDelete
isAutoDelete: boolean = false;Inherited from
IsAutoDelete
IsAutoDelete: Mock<() => boolean>;Returns
Whether the engine owns and deletes this window with its parent.
Implementation of
CUIComboBox.IsAutoDeleteInherited from
IsCursorOverWindow
IsCursorOverWindow: Mock<() => boolean>;Returns
Whether the UI cursor is currently over this window.
Implementation of
CUIComboBox.IsCursorOverWindowInherited from
MockCUIWindow.IsCursorOverWindow
isEnabled
isEnabled: boolean = false;Inherited from
IsEnabled
IsEnabled: Mock<() => boolean>;Returns
Whether the window accepts interaction.
Implementation of
CUIComboBox.IsEnabledInherited from
isPostProcessMode
isPostProcessMode: boolean = false;Inherited from
MockCUIWindow.isPostProcessMode
isShown
isShown: boolean = false;Inherited from
IsShown
IsShown: Mock<() => boolean>;Returns
Whether the window is visible.
Implementation of
CUIComboBox.IsShownInherited from
isVertScrollEnabled
isVertScrollEnabled: boolean = false;items
items: Map<number, string>;listLength
listLength: number = 0;mouseX
mouseX: number = 0;Inherited from
mouseY
mouseY: number = 0;Inherited from
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
CUIComboBox.ResetPPModeInherited from
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
CUIComboBox.SetAutoDeleteInherited from
SetCurrentID
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
CUIComboBox.SetCurrentIDSetCurrentIdx
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
CUIComboBox.SetCurrentIdxSetCurrentOptValue
SetCurrentOptValue: Mock<UnknownFunction>;Apply the current option value from engine options.
Implementation of
CUIComboBox.SetCurrentOptValueSetCurrentValue
SetCurrentValue: Mock<UnknownFunction>;Apply the current combo value.
Implementation of
CUIComboBox.SetCurrentValueSetFont
SetFont: Mock<(font: CGameFont) => void>;Set the font used by this window.
Param
font
Font object.
Implementation of
CUIComboBox.SetFontInherited from
SetHeight
SetHeight: Mock<(height: number) => void>;Set window height.
Param
height
New height.
Implementation of
CUIComboBox.SetHeightInherited from
SetListLength
SetListLength: Mock<(length: number) => void>;Set visible list length.
Param
length
Maximum visible item count.
Implementation of
CUIComboBox.SetListLengthSetPPMode
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
CUIComboBox.SetPPModeInherited from
SetText
SetText: Mock<(text: string) => void>;Set the visible text.
Param
text
Text to show.
Implementation of
CUIComboBox.SetTextSetVertScroll
SetVertScroll: Mock<(enabled: boolean) => void>;Enable or disable the vertical scrollbar.
Param
enabled
Whether vertical scrolling is enabled.
Implementation of
CUIComboBox.SetVertScrollSetWidth
SetWidth: Mock<(width: number) => void>;Set window width.
Param
width
New width.
Implementation of
CUIComboBox.SetWidthInherited from
SetWindowName
SetWindowName: Mock<(name: string) => void>;Set debug/window name.
Param
name
Window name.
Implementation of
CUIComboBox.SetWindowNameInherited from
SetWndPos
SetWndPos: Mock<(positionOrX: number | vector2, y?: number) => void>;Set window position.
Param
vector2
New position.
Implementation of
CUIComboBox.SetWndPosInherited from
SetWndRect
SetWndRect: Mock<(rectOrX: number | Frect, y?: number, width?: number, height?: number) => void>;Set window rectangle.
Param
rect
New rectangle.
Implementation of
CUIComboBox.SetWndRectInherited from
SetWndSize
SetWndSize: Mock<(sizeOrWidth: number | vector2, height?: number) => void>;Set window size.
Param
vector2
New size.
Implementation of
CUIComboBox.SetWndSizeInherited from
text
text: string = "";windowFont
windowFont: CGameFont | null = null;Inherited from
windowName
windowName: string | null = null;Inherited from
WindowName
WindowName: Mock<() => string>;Returns
Window name.
Implementation of
CUIComboBox.WindowNameInherited from
windowPosition
windowPosition: vector2;Inherited from
windowRect
windowRect: Frect | null = null;Inherited from
windowSize
windowSize: vector2;