[signal] add Signal0

This commit is contained in:
2019-04-07 20:46:35 +03:00
parent 493a319ef5
commit 33f4b3eea0
2 changed files with 16 additions and 4 deletions

View File

@@ -23,6 +23,17 @@ class BaseSignal<R> {
}
}
typedef Receiver0 = Void -> Void;
class Signal0 extends BaseSignal<Receiver0> {
public function emit():Void {
for (receiver in receivers) {
receiver();
}
}
}
typedef Receiver1<A> = A -> Void;
class Signal1<A> extends BaseSignal<Receiver1<A>> {

View File

@@ -1,5 +1,6 @@
package haxework.view.skin;
import haxework.view.utils.DrawUtil.FillType;
import haxework.view.layout.ILayout;
import haxework.view.core.Geometry;
import flash.display.BitmapData;
@@ -10,8 +11,8 @@ class Skin {
return new GeometrySkin(new Geometry().setSize(width, height));
}
public static function bitmap(image:BitmapData):ISkin<SpriteView> {
return new BitmapSkin(image);
public static function bitmap(image:BitmapData, fillType:FillType = null):ISkin<SpriteView> {
return new BitmapSkin(image, fillType);
}
public static function color(color:Int, alpha:Float = 1.0):ISkin<SpriteView> {
@@ -30,8 +31,8 @@ class Skin {
return new ButtonColorSkin(color, alpha);
}
public static function buttonBitmap(image:BitmapData):ISkin<ButtonView> {
return new ButtonBitmapSkin(image);
public static function buttonBitmap(image:BitmapData, fillType:FillType = null):ISkin<ButtonView> {
return new ButtonBitmapSkin(image, fillType);
}
public static function tabColor(color:Int, alpha:Float = 1.0):ISkin<ButtonView> {