From 33f4b3eea0ea724462331486691b797fd02b4743 Mon Sep 17 00:00:00 2001 From: shmyga Date: Sun, 7 Apr 2019 20:46:35 +0300 Subject: [PATCH] [signal] add Signal0 --- src/main/haxework/signal/Signal.hx | 11 +++++++++++ src/main/haxework/view/skin/Skin.hx | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/haxework/signal/Signal.hx b/src/main/haxework/signal/Signal.hx index d912578..75d2a8a 100644 --- a/src/main/haxework/signal/Signal.hx +++ b/src/main/haxework/signal/Signal.hx @@ -23,6 +23,17 @@ class BaseSignal { } } +typedef Receiver0 = Void -> Void; + +class Signal0 extends BaseSignal { + + public function emit():Void { + for (receiver in receivers) { + receiver(); + } + } +} + typedef Receiver1 = A -> Void; class Signal1 extends BaseSignal> { diff --git a/src/main/haxework/view/skin/Skin.hx b/src/main/haxework/view/skin/Skin.hx index 7328cba..0714a06 100644 --- a/src/main/haxework/view/skin/Skin.hx +++ b/src/main/haxework/view/skin/Skin.hx @@ -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 { - return new BitmapSkin(image); + public static function bitmap(image:BitmapData, fillType:FillType = null):ISkin { + return new BitmapSkin(image, fillType); } public static function color(color:Int, alpha:Float = 1.0):ISkin { @@ -30,8 +31,8 @@ class Skin { return new ButtonColorSkin(color, alpha); } - public static function buttonBitmap(image:BitmapData):ISkin { - return new ButtonBitmapSkin(image); + public static function buttonBitmap(image:BitmapData, fillType:FillType = null):ISkin { + return new ButtonBitmapSkin(image, fillType); } public static function tabColor(color:Int, alpha:Float = 1.0):ISkin {