bright-gpu-74537
02/21/2020, 4:56 PMnutritious-boots-87264
02/21/2020, 4:59 PMbright-gpu-74537
02/21/2020, 5:00 PMbright-gpu-74537
02/21/2020, 6:48 PMnutritious-boots-87264
02/22/2020, 4:39 PM:bind(id, event)
macro? I would prefer getting a compile time error in case of incorrectly spelled instead of runtime one. If it's necessary to preserve compatibility with old one, it can be called bindStatic or something like that.bright-gpu-74537
02/23/2020, 12:52 PMbright-gpu-74537
02/23/2020, 12:54 PMuser
02/25/2020, 7:25 PMuser
02/25/2020, 7:25 PMuser
02/25/2020, 7:29 PMuser
02/25/2020, 9:59 PMbright-gpu-74537
02/25/2020, 11:02 PMbright-gpu-74537
02/25/2020, 11:02 PMbright-gpu-74537
02/25/2020, 11:03 PMuser
02/26/2020, 3:16 AMuser
02/26/2020, 3:17 AMuser
02/26/2020, 3:20 AMuser
02/26/2020, 3:34 PMuser
02/26/2020, 3:35 PMbright-gpu-74537
02/26/2020, 4:30 PMbright-gpu-74537
02/26/2020, 4:30 PMxml
<?xml version="1.0" encoding="utf-8" ?>
<vbox>
<hslider id="xpos" />
<hslider id="ypos" />
<hslider id="zpos" />
<checkbox id="boolInput" />
<textfield id="stringInput" />
</vbox>
bright-gpu-74537
02/26/2020, 4:30 PMhaxe
import haxe.ui.containers.Box;
import haxe.ui.events.UIEvent;
typedef Data = {
@:optional public var x:Float;
@:optional public var y:Float;
@:optional public var z:Float;
@:optional public var check:Bool;
@:optional public var text:Float;
}
@:build(haxe.ui.macros.ComponentMacros.build("assets/test_c.xml"))
class TestComponent extends Box {
private var _data:Data = {};
public function new() {
super();
}
@:bind(xpos, UIEvent.CHANGE)
@:bind(ypos, UIEvent.CHANGE)
@:bind(zpos, UIEvent.CHANGE)
@:bind(boolInput, UIEvent.CHANGE)
@:bind(stringInput, UIEvent.CHANGE)
private function onValueChanged(e:UIEvent) {
switch (e.target.id) {
case "xpos":
_data.x = e.target.value;
case "ypos":
_data.y = e.target.value;
case "zpos":
_data.z = e.target.value;
case "boolInput":
_data.check = e.target.value;
case "stringInput":
_data.text = e.target.value;
}
trace(_data);
}
}
bright-gpu-74537
02/26/2020, 4:31 PMbright-gpu-74537
02/26/2020, 4:31 PMbright-gpu-74537
02/26/2020, 4:32 PMbright-gpu-74537
02/26/2020, 4:34 PMbright-gpu-74537
02/26/2020, 4:34 PMbright-gpu-74537
02/26/2020, 4:35 PMbright-gpu-74537
02/26/2020, 4:36 PMbright-gpu-74537
02/26/2020, 4:36 PM