class
Button
General purpose push button that supports both text and icon as well as repeat event dispatching
Composite children
Id | Type | Style Name | Notes |
---|---|---|---|
button-label | haxe.ui.components.Label | .label | The text of the button (if applicable) |
button-icon | haxe.ui.components.Image | .icon | The icon of the button (if applicable) |
Pseudo classes
Name | Notes |
---|---|
:hover | The style to be applied when the cursor is over the button |
:down | The style to be applied when a mouse button is pressed inside the button |
:active | The style to be applied when the button has focus |
:disabled | The style to be applied when the button is disabled |
XML example
<button text="Button"
styleNames="myCustomButton"
style="font-size: 30px"
onClick="trace('hello world')" />
Code example
var button = new Button();
button.text = "Button";
button.styleNames = "myCustomButton";
button.fontSize = 30;
button.onClick = function(e) {
trace("hello world");
}
See Also: | Component Explorer Example, ButtonBar |
componentGroup:String
easeInRepeater:Bool
Whether this button will ease in to specified repeatInterval
icon:Variant
The image resource to use as the buttons icon
remainPressed:Bool
Whether the buttons state should remain pressed even when the mouse has left its bounds
repeatInterval:Int
How often this button will dispatch multiple click events while the the mouse is
pressed within it, in milliseconds. Default is 100.
pressed within it, in milliseconds. Default is 100.
repeater:Bool
Whether this button will dispatch multiple click events while the the mouse is pressed within it
selected:Bool
Whether this button is toggled or not (only relevant if toggle = true)
toggle:Bool
Whether this button should behave as a toggle button or not
(a button that behaves like a switch, being either on/off)
(a button that behaves like a switch, being either on/off)