sample fix
This commit is contained in:
4
samples/01-base/build.hxml
Normal file
4
samples/01-base/build.hxml
Normal file
@@ -0,0 +1,4 @@
|
||||
-cp src
|
||||
-lib haxework
|
||||
-main ViewExample.hx
|
||||
-swf target/ViewExample.swf
|
||||
24
samples/01-base/src/ViewExample.hx
Executable file
24
samples/01-base/src/ViewExample.hx
Executable file
@@ -0,0 +1,24 @@
|
||||
package;
|
||||
|
||||
import haxework.gui.ViewBuilder;
|
||||
import haxework.gui.VGroupView;
|
||||
import haxework.gui.ButtonView;
|
||||
import haxework.gui.Root;
|
||||
|
||||
@:template("form.json")
|
||||
class FormView extends VGroupView implements ViewBuilder {}
|
||||
|
||||
class ViewExample {
|
||||
|
||||
public static function main() {
|
||||
new ViewExample();
|
||||
}
|
||||
|
||||
public function new() {
|
||||
new Root(new FormView({listener:this}));
|
||||
}
|
||||
|
||||
public function onPress(view:ButtonView):Void {
|
||||
trace("onPress: " + view.id);
|
||||
}
|
||||
}
|
||||
66
samples/01-base/src/form.json
Executable file
66
samples/01-base/src/form.json
Executable file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"type":"haxework.gui.VGroupView",
|
||||
"paddings":20,
|
||||
"layoutMargin":10,
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0xff0000"},
|
||||
"views":[
|
||||
{
|
||||
"type":"haxework.gui.SpriteView",
|
||||
"pWidth":100,
|
||||
"pHeight":100,
|
||||
"leftMargin":5,
|
||||
"rightMargin":10,
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0x00ff00"}
|
||||
},
|
||||
{
|
||||
"type":"haxework.gui.SpriteView",
|
||||
"vAlign":"BOTTOM",
|
||||
"width":50,
|
||||
"height":50,
|
||||
"leftMargin":5,
|
||||
"rightMargin":10,
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0x0000ff"}
|
||||
},
|
||||
{
|
||||
"id":"panel",
|
||||
"type":"haxework.gui.HGroupView",
|
||||
"layoutHAlign":"RIGHT",
|
||||
"pWidth":100,
|
||||
"height":30,
|
||||
"paddings":3,
|
||||
"layoutMargin":3,
|
||||
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0xffff00"},
|
||||
"views":[
|
||||
{
|
||||
"id":"button1",
|
||||
"type":"haxework.gui.ButtonView",
|
||||
"width":100,
|
||||
"pHeight":100,
|
||||
"skin":{"type":"haxework.gui.skin.ButtonColorSkin", "color":"0xcc0000"},
|
||||
"text":"Text1",
|
||||
"onPress":"@link:listener"
|
||||
},
|
||||
{
|
||||
"id":"button2",
|
||||
"type":"haxework.gui.ButtonView",
|
||||
"contentSize":true,
|
||||
"skin":{"type":"haxework.gui.skin.ButtonColorSkin", "color":"0x00cc00"},
|
||||
"text":"Text2",
|
||||
"fontFamily":"Georgia",
|
||||
"fontColor":"0xffffff",
|
||||
"onPress":"@link:listener"
|
||||
},
|
||||
{
|
||||
"id":"button3",
|
||||
"type":"haxework.gui.ButtonView",
|
||||
"contentSize":true,
|
||||
"skin":{"type":"haxework.gui.skin.ButtonColorSkin", "color":"0x00cccc"},
|
||||
"text":"Text 3333333333 ddd",
|
||||
"fontFamily":"Tahoma",
|
||||
"fontColor":"0xff0000",
|
||||
"onPress":"@link:listener"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user