📜CMenuComboBox

CMenuComboBox metatable.

:Name(): string

Returns widget's name.


:Update(items: string[], defaultValue [?]: integer): nil

NameTypeDescription

items

string[]

defaultValue [?]

integer

Index of default item. (starts from 0) (default: 0)

Update the combo box values.


Returns widget's parent.


Returns widget type.


:Open(): nil

Opens parent tabs.


:ForceLocalization(newText: string): nil

Not recommended for use due to its complexity

NameTypeDescription

newText

string

Changes text in the widget. The path to the widget is not affected. May be used for dynamic text customization or recolor.


:ToolTip(newText: string): string

NameTypeDescription

newText

string

Gets or sets tooltip. Tooltip is displayed when mouse cursor is over the widget. Depends on the argument.


:ToolTip(): string


:Visible(value: boolean): nil

NameTypeDescription

value

boolean

Gets or sets visible state. Depends on argument.

Example

-- setter
widget:Visible(false)

:Visible(): boolean

Example

-- getter
local isVisible = widget:Visible()

:Disabled(value: boolean): nil

NameTypeDescription

value

boolean

Gets or sets disabled state. Depends on argument.

Example

-- setter
widget:Disabled( false )

:Disabled(): boolean

Example

-- getter
local isDisabled = widget:Disabled()

:Unsafe(value: boolean): nil

NameTypeDescription

value

boolean

Gets or sets unsafe state. Unsafe widgets have warning sign. Depends on argument.


:Unsafe(): boolean


:Get(): integer

Returns index of the selected item. It starts from 0.


:Set(value: integer): nil

NameTypeDescription

value

integer

Sets widget's value.


:List(): string[]

Returns array of the items.


:Image(imagePath: string, offset [?]: Vec2): nil

NameTypeDescription

imagePath

string

Path to the image.

offset [?]

Optional image offset. (default: {0.0, 0.0})

Sets widget's image.


:Icon(icon: string, offset [?]: Vec2): nil

NameTypeDescription

icon

string

icon unicode.

offset [?]

Optional icon offset. (default: {0.0, 0.0})

Sets widget's icon. Icons list

Example

--https://fontawesome.com/icons/user?f=classic&s=solid
widget:Icon("\f{007}")

:SetCallback(callback: fun(this: CMenuComboBox):nil, forceCall [?]: boolean): nil

Multiple callbacks could be set.

NameTypeDescription

callback

fun(this: CMenuComboBox):nil

function to be called on widget change.

forceCall [?]

boolean

true if you want to call callback on widget creation. (default: false)

Sets widget's on change callback.


:UnsetCallback(callback: fun(this: CMenuComboBox):nil): nil

NameTypeDescription

callback

fun(this: CMenuComboBox):nil

function to be removed from widget's callbacks.

Removes widget's on change callback.


:ColorPicker(name: string, color: Color): CMenuColorPickerAttachment

NameTypeDescription

name

string

Name of the attachment.

color

Default color.

Creates CMenuColorPickerAttachment and attaches it to the widget.


:Gear(name: string, gearIcon [?]: string, useSmallFont [?]: boolean): CMenuGearAttachment

NameTypeDescription

name

string

Name of the attachment.

gearIcon [?]

string

Gear FontAwesome icon. (default: "\uf013")

useSmallFont [?]

boolean

Use small font for gear icon. (default: true)

Creates CMenuGearAttachment and attaches it to the widget.

Last updated