MQWidget.Button class

A button class.

Super classes: MQWidget.WidgetBase

Property

get set Type Name Description
x x string text a displayed string
x x string fontName a font name
x x bool fontBold a bold font
x x float fontScale a font scale
x x MQWidget.ColorI4 fontColor a font color
x x string alignment an alignment for a text
[left] left
[right] right
[center] center
x x bool toggle an automatic switching
x x bool down a down status
x x bool repeat a repeatability
x x bool chain a chain display with neighbor buttons
x x bool flat a flat style display
x x float paddingX a horizontal padding between a text and an icon
x x float paddingY a vertical padding between a text and an icon
x string systemSVGFile a filename for a system .svg file
x x float imageScale a scaling for a svg image
x x string imagePosition an alignment for a svg image
[left] left
[right] right
[top] top
[bottom] bottom
x bool default as a default button
x bool cancel as a cancel button
x string modalResult a result for a dialog

Method

Member Description
Button Constructor.
addClickEvent Add an event for a click.
addRepeatEvent Add an event for holding down.

Button([parent])

Constructor.

Parameters:
MQWidget.WidgetBase parent - A parent widget

addClickEvent(callback)

Add an event for a click.

Parameters:
function(sender) callback - callback function

addRepeatEvent(callback)

Add an event for holding down.

Parameters:
function(sender) callback - callback function