flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [05/12] git commit: [flex-asjs] [refs/heads/develop] - handle size changes
Date Mon, 12 Jan 2015 18:50:57 GMT
handle size changes


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/34e08009
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/34e08009
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/34e08009

Branch: refs/heads/develop
Commit: 34e0800900d29248bbcafc684c449238c89230dc
Parents: 1f51340
Author: Alex Harui <aharui@apache.org>
Authored: Mon Jan 12 10:46:00 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Jan 12 10:46:00 2015 -0800

----------------------------------------------------------------------
 .../apache/flex/html/beads/DownArrowButtonView.as   | 11 ++++++++++-
 .../org/apache/flex/html/beads/UpArrowButtonView.as | 16 +++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/34e08009/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DownArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DownArrowButtonView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DownArrowButtonView.as
index 39ce6b4..119b0c7 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DownArrowButtonView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DownArrowButtonView.as
@@ -25,6 +25,7 @@ package org.apache.flex.html.beads
     import org.apache.flex.core.BeadViewBase;
 	import org.apache.flex.core.IStrand;
     import org.apache.flex.core.IBeadView;
+    import org.apache.flex.events.Event;
 	
     /**
      *  The DownArrowButtonView class is the view for
@@ -92,11 +93,19 @@ package org.apache.flex.html.beads
 			SimpleButton(value).downState = downView;
 			SimpleButton(value).overState = overView;
 			SimpleButton(value).hitTestState = shape;
-		}
+
+            SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+            SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
+        }
 				
 		private var upView:Shape;
 		private var downView:Shape;
 		private var overView:Shape;
         
+        private function sizeChangeHandler(event:Event):void
+        {
+            SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 16;
+            SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 16;
+        }
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/34e08009/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/UpArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/UpArrowButtonView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/UpArrowButtonView.as
index 10101ed..74c4ffd 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/UpArrowButtonView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/UpArrowButtonView.as
@@ -18,13 +18,15 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.beads
 {
+	import flash.display.DisplayObject;
 	import flash.display.Graphics;
 	import flash.display.Shape;
 	import flash.display.SimpleButton;
-
-    import org.apache.flex.core.BeadViewBase;
+	
+	import org.apache.flex.core.BeadViewBase;
+	import org.apache.flex.core.IBeadView;
 	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IBeadView;
+    import org.apache.flex.events.Event;
 	
     /**
      *  The UpArrowButtonView class is the view for
@@ -92,11 +94,19 @@ package org.apache.flex.html.beads
 			SimpleButton(value).downState = downView;
 			SimpleButton(value).overState = overView;
 			SimpleButton(value).hitTestState = shape;
+            
+            SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+            SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
 		}
         
 		private var upView:Shape;
 		private var downView:Shape;
 		private var overView:Shape;
 		
+        private function sizeChangeHandler(event:Event):void
+        {
+            SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 16;
+            SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 16;
+        }
 	}
 }


Mime
View raw message