bright-gpu-74537
05/14/2021, 10:00 AMbright-gpu-74537
05/14/2021, 10:01 AMmost-caravan-45834
05/14/2021, 5:06 PMmost-caravan-45834
05/14/2021, 5:07 PMbright-gpu-74537
05/14/2021, 5:21 PMplain-scientist-42592
05/15/2021, 8:13 AMbright-gpu-74537
05/15/2021, 8:16 AMplain-scientist-42592
05/15/2021, 10:28 AMmost-caravan-45834
05/15/2021, 11:29 PMmost-caravan-45834
05/15/2021, 11:29 PMbright-gpu-74537
05/16/2021, 6:36 AM.closable i think is the propmost-caravan-45834
05/16/2021, 6:37 PMmost-caravan-45834
05/17/2021, 9:19 PMmost-caravan-45834
05/17/2021, 9:19 PMxml
<module>
<components>
<component file="assets/haxeui/zoom_selector.xml" class="ui.ZoomSelector" alias="ZoomSelector" />
</components>
</module>most-caravan-45834
05/17/2021, 9:19 PMxml
<hbox>
<button id="decreaseButton" text="-" verticalAlign="center" />
<label id="zoomLabel" text="1" width="16" verticalAlign="center" />
<button id="increaseButton" text="+" verticalAlign="center" />
</hbox>most-caravan-45834
05/17/2021, 9:20 PMhaxe
package ui;
import haxe.ui.containers.HBox;
@:build(haxe.ui.macros.ComponentMacros.build("assets/haxeui/zoom_selector.xml"))
class ZoomSelector extends HBox
{
public function new()
{
super();
increaseButton.onClick = onIncreaseClicked;
decreaseButton.onClick = onDecreaseClicked;
}
function onIncreaseClicked(e: MouseEvent)
{
trace("teste");
}
function onDecreaseClicked(e: MouseEvent)
{
trace("teste");
}
}most-caravan-45834
05/17/2021, 9:21 PMxml
<zoom-selector />most-caravan-45834
05/17/2021, 9:21 PMmost-caravan-45834
05/17/2021, 9:22 PMmost-caravan-45834
05/17/2021, 10:57 PMmost-caravan-45834
05/17/2021, 11:45 PMhaxe
package ui;
import haxe.ui.events.MouseEvent;
import haxe.ui.containers.HBox;
@:build(haxe.ui.macros.ComponentMacros.build("assets/haxeui/zoom_selector.xml"))
class ZoomSelector extends HBox
{
public function new()
{
super();
}
@:bind(zoomLabel.text)
public var textfieldText:String = "10";
@:bind(decreaseButton, MouseEvent.CLICK)
function onDecrease(e)
{
var n = Std.parseInt(textfieldText) - 1;
textfieldText = Std.string(n);
}
@:bind(increaseButton, MouseEvent.CLICK)
function onIncrease(e) {
var n = Std.parseInt(textfieldText) + 1;
textfieldText = Std.string(n);
}
}
This gives me
{ text : Unknown<0> } should be haxe.ui.core.Component
{ text : haxe.ui.util.Variant } should be haxe.ui.core.Componentmost-caravan-45834
05/17/2021, 11:47 PMmost-caravan-45834
05/17/2021, 11:58 PMmost-caravan-45834
05/18/2021, 12:26 AMbright-gpu-74537
05/18/2021, 6:17 AMhaxe
@:bind(zoomLabel.text)
public var textfieldText:String = "10";
looks fine to me, ill check it out.
> What about integrating the "value" of the component and onChange callbacks?
Im not sure i follow, you could get the value from e.target.value if you wanted, no?most-caravan-45834
05/18/2021, 4:37 PMmost-caravan-45834
05/18/2021, 4:37 PMmost-caravan-45834
05/18/2021, 4:38 PMmost-caravan-45834
05/18/2021, 4:46 PMbright-gpu-74537
05/18/2021, 4:49 PM