[skin] update

This commit is contained in:
2019-02-07 17:55:49 +03:00
parent eeb659622c
commit e517c0a298
23 changed files with 225 additions and 150 deletions

View File

@@ -4,7 +4,7 @@
-lib promhx
-main ViewExample.hx
--macro haxework.parser.Parser.auto()
-swf-version 10.1
-swf-header 800:600:30:000000
-swf target/ViewExample.swf
#-as3 target

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
echo "`pwd`/target" > ~/.macromedia/Flash_Player/#Security/FlashPlayerTrust/haxework_test.cfg
. /opt/sdk/haxe/3.4.7/activate
haxe build.hxml && flashplayerdebugger target/ViewExample.swf

View File

@@ -1,5 +1,11 @@
package;
import haxework.net.manage.LoaderManager;
import haxework.net.manage.ILoaderManager;
import haxework.net.JsonLoader;
import haxework.gui.skin.ISkin.SkinSet;
import haxework.gui.skin.ButtonColorSkin;
import haxework.gui.skin.TextSkin;
import flash.display.Sprite;
import haxework.gui.list.ListView.IListItemView;
import haxework.gui.list.VListView;
@@ -17,9 +23,13 @@ class FormView extends VGroupView {
@:view public var button2(default, null):ButtonView;
@:view public var button3(default, null):ButtonView;
private var buttonSkin: SkinSet = [
new ButtonColorSkin(0x33aa33),
new TextSkin(0xffffff, "Courirer"),
];
private function init() {
trace("init");
list.data = [for (i in 0...100) StringTools.hex(Math.floor(Math.random() * 1e9))];
}
private function onPress(view:ButtonView):Void {
@@ -33,7 +43,10 @@ class FormView extends VGroupView {
class ViewExample {
@:provide private static var manager:ILoaderManager;
public static function main() {
manager = new LoaderManager(1);
new ViewExample();
}
@@ -44,5 +57,10 @@ class ViewExample {
trace(form.button1);
trace(form.button2);
trace(form.button3);
new JsonLoader().GET("http://umix.tv/channel/data2/renova.json")
.then(function(data:Array<Dynamic>) {
form.list.data = data.map(function(item) return '${item.id}: ${item.message}');
})
.catchError(function(error) trace(error));
}
}

View File

@@ -2,7 +2,7 @@
$type: haxework.gui.VGroupView
paddings: 20
layoutMargin: 10
skin: [ $type: [haxework.gui.skin.Skin.color, 0xff0000] ]
skin: [ $type: [haxework.gui.skin.Skin.color, 0x333333] ]
views:
- id: list
$type: haxework.gui.list.VListView<String>
@@ -14,44 +14,34 @@ views:
$type: haxework.gui.list.VScrollView
width: 10
pHeight: 100
skin: [ $type: [haxework.gui.list.ScrollSkin.vertical, 0xcffcc, 0x55cc55] ]
skin: [ $type: [haxework.gui.list.ScrollSkin.vertical, 0x55cc55, 0xccffcc] ]
skin: [ $type: [haxework.gui.skin.Skin.color, 0xffffff] ]
- $type: haxework.gui.SpriteView
vAlign: BOTTOM
width: 50
height: 50
leftMargin: 5
rightMargin: 10
skin: [ $type: [haxework.gui.skin.Skin.color, 0x0000ff] ]
- id: panel
$type: haxework.gui.HGroupView
layoutHAlign: RIGHT
pWidth: 100
height: 30
paddings: 3
layoutMargin: 3
skin: [ $type: [haxework.gui.skin.Skin.color, 0xffff00] ]
height: 60
# contentSize: true
layoutMargin: 10
skin: [ $type: [haxework.gui.skin.Skin.color, 0x555555] ]
views:
- id: button1
$type: haxework.gui.ButtonView
+onPress: $this:onPress
width: 100
pHeight: 100
skin: [ $type: [haxework.gui.skin.ButtonSkin.color, 0xcc0000] ]
text: Text1
contentSize: true
paddings: 8
skin: $this:buttonSkin
text: OK
- id: button2
$type: haxework.gui.ButtonView
+onPress: $this:onPress
contentSize: true
skin: [ $type: [haxework.gui.skin.ButtonSkin.color, 0x00cc00] ]
text: Text2
fontFamily: Georgia
fontColor: 0xffffff
paddings: 8
skin: $this:buttonSkin
text: Apply
- id: button3
$type: haxework.gui.ButtonView
+onPress: $this:onPress
contentSize: true
skin: [ $type: [haxework.gui.skin.ButtonSkin.color, 0x00cccc] ]
text: Text 3333333333 ddd
fontFamily: Tahoma
fontColor: 0xff0000
paddings: 8
skin: $this:buttonSkin
text: Cancel