CMenuSwitch
Last updated
Last updated
CMenuSwitch metatable.
:Name():
string
Returns widget's name.
:Parent():
|
Returns widget's parent.
:Type():
Returns widget type.
:Open():
nil
Opens parent tabs.
: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(newText):
string
newText
string
Gets or sets tooltip. Tooltip is displayed when mouse cursor is over the widget. Depends on the argument.
:ToolTip():
string
:Visible(value):
nil
value
boolean
Gets or sets visible state. Depends on argument.
:Visible():
boolean
:Disabled(value):
nil
value
boolean
Gets or sets disabled state. Depends on argument.
:Disabled():
boolean
:Unsafe(value):
nil
value
boolean
Gets or sets unsafe state. Unsafe widgets have warning sign. Depends on argument.
:Unsafe():
boolean
:Get():
boolean
Returns widget's value.
:Set(value):
nil
value
boolean
Sets widget's value.
:Image(imagePath, [offset]):
nil
imagePath
string
Path to the image.
offset [?]
Optional image offset. (default: {0.0, 0.0})
Sets widget's image.
:ImageHandle(imageHandle, [offset]):
nil
imageHandle
integer
offset [?]
Optional image offset. (default: {0.0, 0.0})
Sets tab's image by already created handle.
:Icon(icon, [offset]):
nil
icon
string
icon unicode.
offset [?]
Optional icon offset. (default: {0.0, 0.0})
`: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(callback):
nil
callback
fun(this: CMenuSwitch):nil
function to be removed from widget's callbacks.
Removes widget's on change callback.
name
string
Name of the attachment.
color
Default color.
Creates CMenuColorPickerAttachment
and attaches it to the widget.
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.
Sets widget's icon.
:ColorPicker(name, color):
:Gear(name, [gearIcon], [useSmallFont]):