This commit is contained in:
3wc 2023-07-30 23:09:48 +01:00
parent 17b1273c6e
commit e4552b8213

View File

@ -1,11 +1,7 @@
@:uiComp("view") @:uiComp("view")
// Naming scheme of component classes can be customized with domkit.Macros.registerComponentsPath(); // Naming scheme of component classes can be customized with domkit.Macros.registerComponentsPath();
class ViewComp extends h2d.Flow implements h2d.domkit.Object { class ViewComp extends h2d.Flow implements h2d.domkit.Object {
static var SRC = <view class="mybox" min-width="200" content-halign={align}>
static var SRC =
<view class="mybox" min-width="200" content-halign={align}>
<text text={"Rewild"}/> <text text={"Rewild"}/>
for( i in icons ) for( i in icons )
<bitmap src={i} id="icons[]"/> <bitmap src={i} id="icons[]"/>
@ -15,19 +11,19 @@ class ViewComp extends h2d.Flow implements h2d.domkit.Object {
super(parent); super(parent);
initComponent(); initComponent();
} }
} }
@:uiComp("button") @:uiComp("button")
class ButtonComp extends h2d.Flow implements h2d.domkit.Object { class ButtonComp extends h2d.Flow implements h2d.domkit.Object {
static var SRC = <button> static var SRC = <button>
<text public id="labelTxt" /> <text public id="labelTxt" />
</button> </button>
public var label(get, set):String; public var label(get, set):String;
function get_label() return labelTxt.text;
function get_label()
return labelTxt.text;
function set_label(s) { function set_label(s) {
labelTxt.text = s; labelTxt.text = s;
return s; return s;
@ -52,13 +48,11 @@ class ButtonComp extends h2d.Flow implements h2d.domkit.Object {
}; };
} }
public dynamic function onClick() { public dynamic function onClick() {}
}
} }
@:uiComp("container") @:uiComp("container")
class ContainerComp extends h2d.Flow implements h2d.domkit.Object { class ContainerComp extends h2d.Flow implements h2d.domkit.Object {
static var SRC = <container> static var SRC = <container>
<view(align,[]) id="view"/> <view(align,[]) id="view"/>
<button public id="btn"/> <button public id="btn"/>
@ -70,13 +64,10 @@ class ContainerComp extends h2d.Flow implements h2d.domkit.Object {
super(parent); super(parent);
initComponent(); initComponent();
} }
} }
// PARAM=-lib domkit // PARAM=-lib domkit
class Main extends hxd.App { class Main extends hxd.App {
var center:h2d.Flow; var center:h2d.Flow;
var style = null; var style = null;
@ -122,6 +113,4 @@ class Main extends hxd.App {
#end #end
new Main(); new Main();
} }
} }