41 lines
816 B
Haxe
41 lines
816 B
Haxe
package components;
|
|
|
|
@:uiComp("menubutton")
|
|
class MenubuttonComponent extends h2d.Flow implements h2d.domkit.Object {
|
|
static var SRC = <menubutton>
|
|
<text text={label} public id="labelTxt" />
|
|
</menubutton>
|
|
|
|
public var label(get, set):String;
|
|
|
|
function get_label()
|
|
return labelTxt.text;
|
|
|
|
function set_label(s) {
|
|
labelTxt.text = s;
|
|
return s;
|
|
}
|
|
|
|
public function new(label:String, ?parent) {
|
|
super(parent);
|
|
initComponent();
|
|
enableInteractive = true;
|
|
interactive.onClick = function(_) onClick();
|
|
interactive.onOver = function(_) {
|
|
dom.hover = true;
|
|
};
|
|
interactive.onPush = function(_) {
|
|
dom.active = true;
|
|
};
|
|
interactive.onRelease = function(_) {
|
|
dom.active = false;
|
|
};
|
|
interactive.onOut = function(_) {
|
|
dom.hover = false;
|
|
};
|
|
}
|
|
|
|
public dynamic function onClick() {}
|
|
}
|
|
|