diff --git a/src/Main.hx b/src/Main.hx index 7bf84d1..6e1600e 100644 --- a/src/Main.hx +++ b/src/Main.hx @@ -1,39 +1,35 @@ - - @:uiComp("view") // Naming scheme of component classes can be customized with domkit.Macros.registerComponentsPath(); class ViewComp extends h2d.Flow implements h2d.domkit.Object { - - static var SRC = - + static var SRC = for( i in icons ) ; - public function new(align:h2d.Flow.FlowAlign,icons:Array,?parent) { + public function new(align:h2d.Flow.FlowAlign, icons:Array, ?parent) { super(parent); initComponent(); } - } - @:uiComp("button") class ButtonComp extends h2d.Flow implements h2d.domkit.Object { - static var SRC = - public var label(get, set): String; - function get_label() return labelTxt.text; + public var label(get, set):String; + + function get_label() + return labelTxt.text; + function set_label(s) { labelTxt.text = s; return s; } - public function new( ?parent ) { + public function new(?parent) { super(parent); initComponent(); enableInteractive = true; @@ -52,13 +48,11 @@ class ButtonComp extends h2d.Flow implements h2d.domkit.Object { }; } - public dynamic function onClick() { - } + public dynamic function onClick() {} } @:uiComp("container") class ContainerComp extends h2d.Flow implements h2d.domkit.Object { - static var SRC =