CMenuSwitch
CMenuSwitch metatable.
Name
:Name(): string
Returns widget's name.
Parent
:Parent(): CMenuGroup | CMenuGearAttachment
Returns widget's parent.
Type
:Type(): Enum.WidgetType
Returns widget type.
Open
:Open(): nil
Opens parent tabs.
ForceLocalization
:ForceLocalization(newText): nil
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
:ToolTip(newText): string
newText
string
Gets or sets tooltip. Tooltip is displayed when mouse cursor is over the widget. Depends on the argument.
ToolTip
:ToolTip(): string
Visible
:Visible(value): nil
value
boolean
Gets or sets visible state. Depends on argument.
Example
-- setter
switch:Visible(false)Visible
:Visible(): boolean
Example
-- getter
local isVisible = switch:Visible()Disabled
:Disabled(value): nil
value
boolean
Gets or sets disabled state. Depends on argument.
Example
-- setter
switch:Disabled( false )Disabled
:Disabled(): boolean
Example
-- getter
local isDisabled = switch:Disabled()Unsafe
:Unsafe(value): nil
value
boolean
Gets or sets unsafe state. Unsafe widgets have warning sign. Depends on argument.
Unsafe
:Unsafe(): boolean
Get
:Get(): boolean
Returns widget's value.
Set
:Set(value): nil
value
boolean
Sets widget's value.
Image
:Image(imagePath, [offset]): nil
imagePath
string
Path to the image.
Sets widget's image.
ImageHandle
:ImageHandle(imageHandle, [offset]): nil
imageHandle
integer
Sets tab's image by already created handle.
Icon
:Icon(icon, [offset]): nil
icon
string
icon unicode.
Sets widget's icon. Icons list
Example
--https://fontawesome.com/icons/user?f=classic&s=solid
switch:Icon("\u{f007}")SetCallback
`:SetCallback(callback, [forceCall]):` **`nil`**
callback
fun(this: CMenuSwitch):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
:UnsetCallback(callback): nil
callback
fun(this: CMenuSwitch):nil
function to be removed from widget's callbacks.
Removes widget's on change callback.
ColorPicker
:ColorPicker(name, color): CMenuColorPickerAttachment
name
string
Name of the attachment.
Creates CMenuColorPickerAttachment and attaches it to the widget.
Gear
:Gear(name, [gearIcon], [useSmallFont]): CMenuGearAttachment
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