flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Changed how size is determined: either explicit (which included padding) or by content. Removed clientWidth/Height from UIBase. Now, .width/.height will return either the last explicit dimension or the conte
Date Fri, 29 May 2015 20:13:05 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop a1a557d54 -> 50d52ce2f


Changed how size is determined: either explicit (which included padding) or by content. Removed
clientWidth/Height from UIBase. Now, .width/.height will return either the last explicit dimension
or the content size plus padding.


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

Branch: refs/heads/develop
Commit: 50d52ce2f4b8e00b56fb6d3c0f4e7d6d129cb090
Parents: a1a557d
Author: Peter Ent <pent@apache.org>
Authored: Fri May 29 16:13:01 2015 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Fri May 29 16:13:01 2015 -0400

----------------------------------------------------------------------
 .../Core/as/src/org/apache/flex/core/IUIBase.as |  22 --
 .../Core/as/src/org/apache/flex/core/UIBase.as  |  96 +++----
 .../as/src/org/apache/flex/core/UIButtonBase.as | 102 +++-----
 .../org/apache/flex/utils/SolidBorderUtil.as    |   2 +
 .../org/apache/flex/html/beads/ButtonBarView.as |  20 --
 .../org/apache/flex/html/beads/ContainerView.as |  16 +-
 .../src/org/apache/flex/html/beads/ListView.as  |   2 +-
 .../src/org/apache/flex/html/beads/PanelView.as |   2 +-
 .../flex/html/beads/PanelWithControlBarView.as  |  16 +-
 .../flex/html/beads/SingleLineBorderBead.as     |   4 +-
 .../flex/html/beads/SolidBackgroundBead.as      |   4 +-
 .../flex/html/beads/layouts/BasicLayout.as      |  12 +-
 .../flex/html/beads/layouts/HorizontalLayout.as |  10 +-
 .../flex/html/beads/layouts/VerticalLayout.as   |  10 +-
 .../supportClasses/TextFieldItemRenderer.as     | 257 ++++++++++++++-----
 .../flex/html/beads/layouts/DataGridLayout.as   |   3 +-
 .../FlexibleFirstChildHorizontalLayout.as       |  10 +-
 17 files changed, 306 insertions(+), 282 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/Core/as/src/org/apache/flex/core/IUIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/IUIBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/IUIBase.as
index a34c3c2..b033edc 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/IUIBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/IUIBase.as
@@ -107,28 +107,6 @@ package org.apache.flex.core
 		 */
 		function get height():Number;
 		function set height(value:Number):void;
-		
-		/**
-		 * The inner width of the component which is
-		 * the width plus left and right padding.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		function get clientWidth():Number;
-		
-		/**
-		 * The inner height of the component which is
-		 * the height plus top and bottom padding.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		function get clientHeight():Number;
         
         /**
          *  Whether the component is visible.

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
index 3bec8fb..1fcac17 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
@@ -164,6 +164,14 @@ package org.apache.flex.core
          */
 		public function get explicitWidth():Number
 		{
+			if (isNaN(_explicitWidth))
+			{
+				var value:* = ValuesManager.valuesImpl.getValue(this, "width");
+				if (value !== undefined) {
+					_explicitWidth = Number(value);
+				}
+			}
+			
 			return _explicitWidth;
 		}
 
@@ -197,6 +205,14 @@ package org.apache.flex.core
          */
         public function get explicitHeight():Number
 		{
+			if (isNaN(_explicitHeight))
+			{
+				var value:* = ValuesManager.valuesImpl.getValue(this, "height");
+				if (value !== undefined) {
+					_explicitHeight = Number(value);
+				}
+			}
+			
 			return _explicitHeight;
 		}
         
@@ -287,44 +303,6 @@ package org.apache.flex.core
 			dispatchEvent(new Event("percentHeightChanged"));
 		}
 		
-		/**
-		 * Returns the inner width of the component which includes its padding but
-		 * not its margins. Basically, the width plus left and right padding.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-		 */
-		public function get clientWidth():Number
-		{
-			var padding:Object = determinePadding();
-			var pl:Number = 0;
-			var pr:Number = 0;
-			if (!isNaN(padding.paddingLeft)) pl = padding.paddingLeft;
-			if (!isNaN(padding.paddingRight)) pr = padding.paddingRight;
-			return width + pl + pr;
-		}
-		
-		/**
-		 * Returns the inner height of the component which includes its padding
-		 * but not its margins. Basically, the height plus top and bottom padding.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-		 */
-		public function get clientHeight():Number
-		{
-			var padding:Object = determinePadding();
-			var pt:Number = 0;
-			var pb:Number = 0;
-			if (!isNaN(padding.paddingTop)) pt = padding.paddingTop;
-			if (!isNaN(padding.paddingBottom)) pb = padding.paddingBottom;
-			return height + pt + pb;
-		}
-		
 		private var _width:Number;
 
         [Bindable("widthChanged")]
@@ -342,18 +320,15 @@ package org.apache.flex.core
          */
         override public function get width():Number
 		{
-			if (isNaN(_width))
-            {
-                var value:* = ValuesManager.valuesImpl.getValue(this, "width");
-                if (value === undefined)
-                {
-                    if (view)
-                        return view.viewWidth;
-                    return $width;
-                }
-				_width = Number(value);
-            }
-			return _width;
+			if (isNaN(explicitWidth))
+			{
+				var w:Number = _width;
+				if (isNaN(w)) w = $width;
+				var padding:Object = determinePadding();
+				return w + padding.paddingLeft + padding.paddingRight;
+			}
+			else
+				return explicitWidth;
 		}
 
         /**
@@ -400,18 +375,15 @@ package org.apache.flex.core
          */
 		override public function get height():Number
 		{
-			if (isNaN(_height))
-            {
-                var value:* = ValuesManager.valuesImpl.getValue(this, "height");
-                if (value === undefined)
-                {
-                    if (view)
-                        return view.viewHeight;
-                    return $height;
-                }
-  	            _height = Number(value);
-            }
-			return _height;
+			if (isNaN(explicitHeight))
+			{
+				var h:Number = _height;
+				if (isNaN(h)) h = $height;
+				var padding:Object = determinePadding();
+				return h + padding.paddingTop + padding.paddingBottom;
+			}
+			else
+				return explicitHeight;
 		}
 
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
index be1bc05..daad54b 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
@@ -123,6 +123,14 @@ package org.apache.flex.core
 		 */
 		public function get explicitWidth():Number
 		{
+			if (isNaN(_explicitWidth))
+			{
+				var value:* = ValuesManager.valuesImpl.getValue(this, "width");
+				if (value !== undefined) {
+					_explicitWidth = Number(value);
+				}
+			}
+			
 			return _explicitWidth;
 		}
 		
@@ -156,6 +164,14 @@ package org.apache.flex.core
 		 */
 		public function get explicitHeight():Number
 		{
+			if (isNaN(_explicitHeight))
+			{
+				var value:* = ValuesManager.valuesImpl.getValue(this, "height");
+				if (value !== undefined) {
+					_explicitHeight = Number(value);
+				}
+			}
+			
 			return _explicitHeight;
 		}
 		
@@ -246,38 +262,6 @@ package org.apache.flex.core
 			dispatchEvent(new Event("percentHeightChanged"));
 		}
 		
-		/**
-		 * Returns the inner width of the component which includes its padding but
-		 * not its margins. Basically, the width plus left and right padding.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get clientWidth():Number
-		{			
-            // button views should already factor in padding to set
-            // the borders
-			return width;
-		}
-		
-		/**
-		 * Returns the inner height of the component which includes its padding
-		 * but not its margins. Basically, the height plus top and bottom padding.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get clientHeight():Number
-		{
-            // button views should already factor in padding to set
-            // the borders
-			return height;
-		}
-		
 		private var _width:Number;
         
         [PercentProxy("percentWidth")]
@@ -291,18 +275,15 @@ package org.apache.flex.core
          */
 		override public function get width():Number
 		{
-            if (isNaN(_width))
-            {
-                var value:* = ValuesManager.valuesImpl.getValue(this, "width");
-                if (value === undefined)
-                {
-                    if (view)
-                        return view.viewWidth;
-                    return $width;
-                }
-                _width = Number(value);
-            }
-            return _width;
+			if (isNaN(explicitWidth))
+			{
+				var w:Number = _width;
+				if (isNaN(w)) w = $width;
+				var padding:Object = determinePadding();
+				return w + padding.paddingLeft + padding.paddingRight;
+			}
+			else
+				return explicitWidth;
 		}
 
         /**
@@ -315,11 +296,7 @@ package org.apache.flex.core
 				explicitWidth = value;
 			}
 			
-			if (_width != value)
-			{
-				_width = value;
-				dispatchEvent(new Event("widthChanged"));
-			}
+			setWidth(value);
 		}
 
         /**
@@ -349,18 +326,15 @@ package org.apache.flex.core
          */
 		override public function get height():Number
 		{
-            if (isNaN(_height))
-            {
-                var value:* = ValuesManager.valuesImpl.getValue(this, "height");
-                if (value === undefined)
-                {
-                    if (view)
-                        return view.viewHeight;
-                    return $height;
-                }
-                _height = Number(value);
-            }
-            return _height;
+			if (isNaN(explicitHeight))
+			{
+				var h:Number = _height;
+				if (isNaN(h)) h = $height;
+				var padding:Object = determinePadding();
+				return h + padding.paddingTop + padding.paddingBottom;
+			}
+			else
+				return explicitHeight;
 		}
         
         /**
@@ -373,11 +347,7 @@ package org.apache.flex.core
 				explicitHeight = value;
 			}
 			
-			if (_height != value)
-			{
-				_height = value;
-				dispatchEvent(new Event("heightChanged"));
-			}
+			setHeight(value);
 		}
         
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
index d261be1..8c65c79 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
@@ -58,6 +58,8 @@ public class SolidBorderUtil
 									  color:uint, backgroundColor:Object = null, 
 									  thickness:int = 1, alpha:Number = 1.0):void
 	{
+		g.clear();
+		
 		g.lineStyle(thickness, color, alpha);
 		if (backgroundColor != null)
 			g.beginFill(uint(backgroundColor));	

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as
index 8259c25..5a89c55 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as
@@ -55,21 +55,6 @@ package org.apache.flex.html.beads
 			super();
 		}
 		
-		private var _border:Border;
-		
-		/**
-		 *  The ButtonBar's border.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		override public function get border():Border
-		{
-			return _border;
-		}
-		
 		private var _strand:IStrand;
 		
 		/**
@@ -84,11 +69,6 @@ package org.apache.flex.html.beads
 		{
 			_strand = value;
 			super.strand = value;
-			
-			_border = new Border();
-			_border.model = new (ValuesManager.valuesImpl.getValue(value, "iBorderModel")) as IBeadModel;
-			_border.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
-			IParent(_strand).addElement(_border);
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
index b9f302c..5798519 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
@@ -158,7 +158,7 @@ package org.apache.flex.html.beads
             changeHandler(event);
         }
         
-        private var inChangeHandler:Boolean;
+        private var inChangeHandler:Boolean = false;
         
         /**
          *  React if the size changed or content changed 
@@ -214,7 +214,7 @@ package org.apache.flex.html.beads
                 if (actualParent != host)
                 {
                     // force the width of the internal content area as desired.
-                    actualParent.setWidth(host.width - padding.paddingLeft - pr);
+                    actualParent.setWidth(host.width);
                 }
                 // run the layout
                 sizeChangedByLayout = layout.layout();
@@ -227,7 +227,7 @@ package org.apache.flex.html.beads
                     if (actualParent != host)
                     {
                         // force the height
-                        actualParent.setHeight(host.height - padding.paddingTop - pb);
+                        actualParent.setHeight(host.height);
                     }
                 }
                 sizeChangedByLayout = layout.layout();
@@ -236,17 +236,18 @@ package org.apache.flex.html.beads
                     // actualParent.width should be the new width after layout.
                     // set the host's width.  This should send a widthChanged event and
                     // have it blocked at the beginning of this method
-                    host.setWidth(padding.paddingLeft + pr + actualParent.width);
+//old                    host.setWidth(padding.paddingLeft + pr + actualParent.width);
+					host.setWidth(actualParent.width);
                 }
             }
             // and if the height is sized to content, set the height now as well.
             if (host != actualParent)
 	        {
                 if (host.isHeightSizedToContent()) {
-                    host.setHeight(padding.paddingTop + pb + actualParent.height);
+                    host.setHeight(actualParent.height);
 				}
                 else
-                    actualParent.setHeight(host.height - padding.paddingTop - pb);
+                    actualParent.setHeight(host.height);
 		    }
 			// if host and actualParent are the same, determine if the layout changed
 			// the size and if, dispatch events based on what changed
@@ -424,7 +425,8 @@ package org.apache.flex.html.beads
             if (inGetViewWidth)
             {
                 //trace("ContainerView: no width set for " + host);
-                return host["$width"];
+				var padding:Object = determinePadding();
+                return host["$width"] + padding.paddingLeft + padding.paddingRight;
             }
             inGetViewWidth = true;
 			var vw:Number = contentView.width;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
index 87ac761..e35e87f 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
@@ -188,7 +188,7 @@ package org.apache.flex.html.beads
 
             _border = new Border();
             _border.model = new (ValuesManager.valuesImpl.getValue(value, "iBorderModel"))
as IBeadModel;
-            _border.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead"))
as IBead);
+            _strand.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead"))
as IBead);
             IParent(_strand).addElement(_border);
             
 			if (_dataGroup == null) {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as
index e9c4299..c67347f 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as
@@ -122,7 +122,7 @@ package org.apache.flex.html.beads
         override protected function determinePadding():Object
         {
             var paddings:Object = super.determinePadding();
-            titleBar.width = UIBase(_strand).clientWidth;
+            titleBar.width = UIBase(_strand).width;
             paddings.paddingTop += titleBar.height;
             return paddings;
         }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
index 1337768..3c46544 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
@@ -154,10 +154,10 @@ package org.apache.flex.html.beads
 		override protected function determinePadding():Object
 		{
 			var paddings:Object = super.determinePadding();
-			titleBar.width = UIBase(_strand).clientWidth;
+			titleBar.width = UIBase(_strand).width;
 			paddings.paddingTop += titleBar.height;
 			
-			controlBar.width = UIBase(_strand).clientWidth;
+			controlBar.width = UIBase(_strand).width;
 			paddings.paddingBottom += controlBar.height;
 
 			return paddings;
@@ -170,7 +170,7 @@ package org.apache.flex.html.beads
 		{
 			super.changeHandler(event);
 			
-			controlBar.y = UIBase(_strand).clientHeight - controlBar.height;
+			controlBar.y = UIBase(_strand).height - controlBar.height;
 		}
 		
 		/**
@@ -181,18 +181,18 @@ package org.apache.flex.html.beads
 			var paddings:Object = determinePadding();
 			titleBar.x = 0;
 			titleBar.y = 0;
-			titleBar.width = UIBase(_strand).clientWidth;
+			titleBar.width = UIBase(_strand).width;
 			
 			if (controlBar) {
 				controlBar.x = 0;
-				controlBar.y = UIBase(_strand).clientHeight - controlBar.height;
-				controlBar.width = UIBase(_strand).clientWidth;
+				controlBar.y = UIBase(_strand).height - controlBar.height;
+				controlBar.width = UIBase(_strand).width;
 			}
 			
 			actualParent.x = paddings.paddingLeft;
 			actualParent.y = titleBar.height + paddings.paddingTop;
-			actualParent.width = UIBase(_strand).clientWidth - paddings.paddingLeft - paddings.paddingRight;
-			actualParent.height = UIBase(_strand).clientHeight - titleBar.height - paddings.paddingTop
- paddings.paddingBottom;
+			actualParent.width = UIBase(_strand).width - paddings.paddingLeft - paddings.paddingRight;
+			actualParent.height = UIBase(_strand).height - titleBar.height - paddings.paddingTop -
paddings.paddingBottom;
 			if (controlBar) actualParent.height -= controlBar.height;
 		}
 	}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
index fbd3800..bd933df 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
@@ -88,8 +88,8 @@ package org.apache.flex.html.beads
 			
             var host:UIBase = UIBase(_strand);
             var g:Graphics = host.graphics;
-            var w:Number = host.clientWidth;
-            var h:Number = host.clientHeight;
+            var w:Number = host.width;
+            var h:Number = host.height;
 			
 			var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
 			if( this == gd ) g.clear();

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
index 3078048..ffa5502 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
@@ -142,8 +142,8 @@ package org.apache.flex.html.beads
 		private function changeHandler(event:Event):void
 		{
             var g:Graphics = Sprite(host).graphics;
-            var w:Number = host.clientWidth;
-            var h:Number = host.clientHeight;
+            var w:Number = host.width;
+            var h:Number = host.height;
 			
 			var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
 			if( this == gd ) g.clear();

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
index a491573..4285bd7 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
@@ -133,7 +133,7 @@ package org.apache.flex.html.beads.layouts
                                 child.width = ww - right;
                         }
                         else
-                            child.x = w - right - child.clientWidth;
+                            child.x = w - right - child.width;
                     }
                     else
                         childData[i] = { ww: ww, left: left, right: right, ilc: ilc, child:
child };
@@ -168,7 +168,7 @@ package org.apache.flex.html.beads.layouts
                                 child.height = hh - bottom;
                         }
                         else
-                            child.y = h - bottom - child.clientHeight;
+                            child.y = h - bottom - child.height;
                     }
                     else
                     {
@@ -184,8 +184,8 @@ package org.apache.flex.html.beads.layouts
                 }
                 if (!childData[i])
                     child.dispatchEvent(new Event("sizeChanged"));
-                maxWidth = Math.max(maxWidth, child.x + child.clientWidth);
-                maxHeight = Math.max(maxHeight, child.y + child.clientHeight);
+                maxWidth = Math.max(maxWidth, child.x + child.width);
+                maxHeight = Math.max(maxHeight, child.y + child.height);
 			}
             if (hostHeightSizedToContent || hostWidthSizedToContent)
             {
@@ -212,7 +212,7 @@ package org.apache.flex.html.beads.layouts
                                         data.child.width = data.ww - data.right;
                                 }
                                 else
-                                    data.child.x = maxWidth - data.right - data.child.clientWidth;
+                                    data.child.x = maxWidth - data.right - data.child.width;
                             }
                         }
                         if (hostHeightSizedToContent)
@@ -229,7 +229,7 @@ package org.apache.flex.html.beads.layouts
                                         data.child.height = data.hh - data.bottom;
                                 }
                                 else
-                                    data.child.y = maxHeight - data.bottom - data.child.clientHeight;
+                                    data.child.y = maxHeight - data.bottom - data.child.height;
                             }
                         }
                         child.dispatchEvent(new Event("sizeChanged"));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
index 95ae30c..9be7be0 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
@@ -189,9 +189,9 @@ package org.apache.flex.html.beads.layouts
                         mb = bottom;
                         marginObject.bottom = mb;
                     }
-                    maxHeight = Math.max(maxHeight, mt + child.clientHeight + mb);
+                    maxHeight = Math.max(maxHeight, mt + child.height + mb);
                 }
-				xx = child.x + child.clientWidth;
+				xx = child.x + child.width;
 				var valign:* = ValuesManager.valuesImpl.getValue(child, "vertical-align");
 				marginObject.valign = valign;
                 if (valign !== undefined)
@@ -225,9 +225,9 @@ package org.apache.flex.html.beads.layouts
                             ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentHeight));
                     }
     				if (obj.valign == "middle")
-    					child.y = (maxHeight - child.clientHeight) / 2;
+    					child.y = (maxHeight - child.height) / 2;
     				else if (valign == "bottom")
-    					child.y = maxHeight - child.clientHeight - obj.marginBottom;
+    					child.y = maxHeight - child.height - obj.marginBottom;
     				else
     					child.y = obj.marginTop;
     			}
@@ -265,7 +265,7 @@ package org.apache.flex.html.beads.layouts
                     }
                 }
                 else
-                    child.y = h - bottom - mb - child.clientHeight;
+                    child.y = h - bottom - mb - child.height;
             }
             if (ilc)
             {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
index d722d09..462d46e 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
@@ -211,9 +211,9 @@ package org.apache.flex.html.beads.layouts
                         mr = right;
                         marginObject.right = mr;
                     }
-                    maxWidth = Math.max(maxWidth, ml + child.clientWidth + mr);         
          
+                    maxWidth = Math.max(maxWidth, ml + child.width + mr);               
    
                 }
-                yy = child.y + child.clientHeight;
+                yy = child.y + child.height;
 			}
             if (hostSizedToContent)
             {
@@ -240,9 +240,9 @@ package org.apache.flex.html.beads.layouts
                     if (hasHorizontalFlex)
                     {
                         if (obj.marginLeft == "auto" && obj.marginRight == "auto")
-                            child.x = maxWidth - child.clientWidth / 2;
+                            child.x = maxWidth - child.width / 2;
                         else if (obj.marginLeft == "auto")
-                            child.x = maxWidth - child.clientWidth - obj.marginRight;
+                            child.x = maxWidth - child.width - obj.marginRight;
                     }
                 }
             }
@@ -279,7 +279,7 @@ package org.apache.flex.html.beads.layouts
                     }
                 }
                 else
-                    child.x = w - right - mr - child.clientWidth;
+                    child.x = w - right - mr - child.width;
             }
             if (ilc)
             {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
index 469a17a..298b66e 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
@@ -63,6 +63,158 @@ package org.apache.flex.html.supportClasses
         public var highlightColor:uint = 0xCEDBEF;
         public var selectedColor:uint = 0xA8C6EE;
         public var downColor:uint = 0x808080;
+		
+		private var _explicitWidth:Number;
+		
+		/**
+		 *  The explicitly set width (as opposed to measured width
+		 *  or percentage width).
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get explicitWidth():Number
+		{
+			if (isNaN(_explicitWidth))
+			{
+				var value:* = ValuesManager.valuesImpl.getValue(this, "width");
+				if (value !== undefined) {
+					_explicitWidth = Number(value);
+				}
+			}
+			
+			return _explicitWidth;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set explicitWidth(value:Number):void
+		{
+			if (_explicitWidth == value)
+				return;
+			
+			// width can be pixel or percent not both
+			if (!isNaN(value))
+				_percentWidth = NaN;
+			
+			_explicitWidth = value;
+			
+			dispatchEvent(new Event("explicitWidthChanged"));
+		}
+		
+		private var _explicitHeight:Number;
+		
+		/**
+		 *  The explicitly set width (as opposed to measured width
+		 *  or percentage width).
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get explicitHeight():Number
+		{
+			if (isNaN(_explicitHeight))
+			{
+				var value:* = ValuesManager.valuesImpl.getValue(this, "height");
+				if (value !== undefined) {
+					_explicitHeight = Number(value);
+				}
+			}
+			
+			return _explicitHeight;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set explicitHeight(value:Number):void
+		{
+			if (_explicitHeight == value)
+				return;
+			
+			// height can be pixel or percent not both
+			if (!isNaN(value))
+				_percentHeight = NaN;
+			
+			_explicitHeight = value;
+			
+			dispatchEvent(new Event("explicitHeightChanged"));
+		}
+		
+		private var _percentWidth:Number;
+		
+		/**
+		 *  The requested percentage width this component
+		 *  should have in the parent container.  Note that
+		 *  the actual percentage may be different if the 
+		 *  total is more than 100% or if there are other
+		 *  components with explicitly set widths.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get percentWidth():Number
+		{
+			return _percentWidth;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set percentWidth(value:Number):void
+		{
+			if (_percentWidth == value)
+				return;
+			
+			if (!isNaN(value))
+				_explicitWidth = NaN;
+			
+			_percentWidth = value;
+			
+			dispatchEvent(new Event("percentWidthChanged"));
+		}
+		
+		private var _percentHeight:Number;
+		
+		/**
+		 *  The requested percentage height this component
+		 *  should have in the parent container.  Note that
+		 *  the actual percentage may be different if the 
+		 *  total is more than 100% or if there are other
+		 *  components with explicitly set heights.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get percentHeight():Number
+		{
+			return _percentHeight;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set percentHeight(value:Number):void
+		{
+			if (_percentHeight == value)
+				return;
+			
+			if (!isNaN(value))
+				_explicitHeight = NaN;
+			
+			_percentHeight = value;
+			
+			dispatchEvent(new Event("percentHeightChanged"));
+		}
 
         private var _width:Number;
 		
@@ -71,24 +223,27 @@ package org.apache.flex.html.supportClasses
 		 */
         override public function get width():Number
         {
-            if (isNaN(_width))
-            {
-                var value:* = ValuesManager.valuesImpl.getValue(this, "width");
-                if (value === undefined)
-                    return $width;
-                _width = Number(value);
-                super.width = value;
-            }
-            return _width;
+			if (isNaN(explicitWidth))
+			{
+				var w:Number = _width;
+				if (isNaN(w)) w = $width;
+				var padding:Object = determinePadding();
+				return w + padding.paddingLeft + padding.paddingRight;
+			}
+			else
+				return explicitWidth;
         }
         override public function set width(value:Number):void
         {
-            if (_width != value)
-            {
-                _width = value;
-                super.width = value;
-                dispatchEvent(new Event("widthChanged"));
-            }
+			if (explicitWidth != value)
+			{
+				explicitWidth = value;
+			}
+			
+			if (value != _width) {
+				_width = value;
+				dispatchEvent( new Event("widthChanged") );
+			}
         }
 		
 		/**
@@ -106,24 +261,28 @@ package org.apache.flex.html.supportClasses
 		 */
         override public function get height():Number
         {
-            if (isNaN(_height))
-            {
-                var value:* = ValuesManager.valuesImpl.getValue(this, "height");
-                if (value === undefined)
-                    return $height;
-                _height = Number(value);
-                super.height = value;
-            }
-            return _height;
+			if (isNaN(explicitHeight))
+			{
+				var h:Number = _height;
+				if (isNaN(h)) h = $height;
+				var padding:Object = determinePadding();
+				return h + padding.paddingTop + padding.paddingBottom;
+			}
+			else
+				return explicitHeight;
         }
+
         override public function set height(value:Number):void
         {
-            if (_height != value)
-            {
-                _height = value;
-                super.height = value;
-                dispatchEvent(new Event("heightChanged"));
-            }
+			if (explicitHeight != value)
+			{
+				explicitHeight = value;
+			}
+			
+			if (_height != value) {
+				_height = value;
+				dispatchEvent(new Event("heightChanged"));
+			}
         }
 		
 		/**
@@ -135,44 +294,6 @@ package org.apache.flex.html.supportClasses
         }
 		
 		/**
-		 * Returns the inner width of the component which includes its padding but
-		 * not its margins. Basically, the width plus left and right padding.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get clientWidth():Number
-		{
-			var padding:Object = determinePadding();
-			var pl:Number = 0;
-			var pr:Number = 0;
-			if (!isNaN(padding.paddingLeft)) pl = padding.paddingLeft;
-			if (!isNaN(padding.paddingRight)) pr = padding.paddingRight;
-			return width + pl + pr;
-		}
-		
-		/**
-		 * Returns the inner height of the component which includes its padding
-		 * but not its margins. Basically, the height plus top and bottom padding.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get clientHeight():Number
-		{
-			var padding:Object = determinePadding();
-			var pt:Number = 0;
-			var pb:Number = 0;
-			if (!isNaN(padding.paddingTop)) pt = padding.paddingTop;
-			if (!isNaN(padding.paddingBottom)) pb = padding.paddingBottom;
-			return height + pt + pb;
-		}
-		
-		/**
 		 *  Determines the top and left padding values, if any, as set by
 		 *  padding style values. This includes "padding" for all padding values
 		 *  as well as "padding-left" and "padding-top".

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
index 4d1a288..d857ac1 100644
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
@@ -110,7 +110,7 @@ package org.apache.flex.html.beads.layouts
          * @copy org.apache.flex.core.IBeadLayout#layout
          */
 		public function layout():Boolean
-		{			
+		{						
 			var sw:Number = UIBase(_strand).width;
 			var sh:Number = UIBase(_strand).height;
 			
@@ -149,7 +149,6 @@ package org.apache.flex.html.beads.layouts
 			header.x = 0;
 			header.y = 0;
 			header.width = sw;
-			header.height = 25;
 			
 			return true;
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/50d52ce2/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
index ead1dc6..6b3c0bc 100644
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
@@ -205,15 +205,15 @@ package org.apache.flex.html.beads.layouts
 						mr = 0;
 				}
 				child.y = mt;
-				maxHeight = Math.max(maxHeight, mt + child.clientHeight + mb);
+				maxHeight = Math.max(maxHeight, mt + child.height + mb);
 				if (i == 0)
                 {
                     child.x = ml;
                     child.width = xx - mr;
                 }
 				else
-                    child.x = xx - child.clientWidth - mr;
-				xx -= child.clientWidth + mr + ml;
+                    child.x = xx - child.width - mr;
+				xx -= child.width + mr + ml;
 				lastmr = mr;
 				var valign:Object = ValuesManager.valuesImpl.getValue(child, "vertical-align");
 				verticalMargins.push({ marginTop: mt, marginBottom: mb, valign: valign });
@@ -223,9 +223,9 @@ package org.apache.flex.html.beads.layouts
 				var obj:Object = verticalMargins[0]
 				child = contentView.getElementAt(i) as IUIBase;
 				if (obj.valign == "middle")
-					child.y = (maxHeight - child.clientHeight) / 2;
+					child.y = (maxHeight - child.height) / 2;
 				else if (valign == "bottom")
-					child.y = maxHeight - child.clientHeight - obj.marginBottom;
+					child.y = maxHeight - child.height - obj.marginBottom;
 				else
 					child.y = obj.marginTop;
 			}


Mime
View raw message