added dispatcher package
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package examples;
|
||||
|
||||
import haxework.gui.IGroupView;
|
||||
import haxework.gui.ButtonView;
|
||||
import haxework.gui.GuiBuilder;
|
||||
import haxework.asset.JsonAsset;
|
||||
import haxework.gui.Root;
|
||||
import haxework.gui.IView;
|
||||
import flash.display.Sprite;
|
||||
|
||||
@:file("examples/form.json")
|
||||
@@ -13,7 +14,12 @@ class ViewExample {
|
||||
|
||||
public static function main() {
|
||||
var form:Dynamic = new Form().value;
|
||||
var v:IView<Sprite> = GuiBuilder.build(form);
|
||||
var listener = {
|
||||
onPress:function(view:ButtonView):Void {
|
||||
trace("onPress: " + view.id);
|
||||
}
|
||||
};
|
||||
var v:IGroupView<Sprite> = GuiBuilder.build(form, {listener:listener});
|
||||
new Root(v);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0x0000ff"}
|
||||
},
|
||||
{
|
||||
"id":"panel",
|
||||
"type":"haxework.gui.HGroupView",
|
||||
"layoutHAlign":"~haxework.gui.core.HAlign:LEFT",
|
||||
"layoutVAlign":"~haxework.gui.core.VAlign:MIDDLE",
|
||||
@@ -34,27 +35,33 @@
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0xffff00"},
|
||||
"views":[
|
||||
{
|
||||
"type":"haxework.gui.LabelView",
|
||||
"id":"button1",
|
||||
"type":"haxework.gui.ButtonView",
|
||||
"width":100,
|
||||
"pHeight":100,
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0x00ffff"},
|
||||
"text":"Text1"
|
||||
"text":"Text1",
|
||||
"onPress":"#listener"
|
||||
},
|
||||
{
|
||||
"type":"haxework.gui.LabelView",
|
||||
"id":"button2",
|
||||
"type":"haxework.gui.ButtonView",
|
||||
"contentSize":true,
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0x00ffff"},
|
||||
"text":"Text2",
|
||||
"fontFamily":"Georgia",
|
||||
"fontColor":"0xffffff"
|
||||
"fontColor":"0xffffff",
|
||||
"onPress":"#listener"
|
||||
},
|
||||
{
|
||||
"type":"haxework.gui.LabelView",
|
||||
"id":"button3",
|
||||
"type":"haxework.gui.ButtonView",
|
||||
"contentSize":true,
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0x00ffff"},
|
||||
"text":"Text 3333333333 ddd",
|
||||
"fontFamily":"Tahoma",
|
||||
"fontColor":"0xff0000"
|
||||
"fontColor":"0xff0000",
|
||||
"onPress":"#listener"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user