flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/2] git commit: [flex-asjs] [refs/heads/develop] - improve css and default sizes
Date Thu, 02 May 2013 04:39:43 GMT
Updated Branches:
  refs/heads/develop af7677eb7 -> 2b7ee0a61


improve css and default sizes


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

Branch: refs/heads/develop
Commit: a077336ad37668151d2d425dec633205779e9788
Parents: af7677e
Author: Alex Harui <aharui@apache.org>
Authored: Wed May 1 15:01:26 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed May 1 15:01:26 2013 -0700

----------------------------------------------------------------------
 frameworks/as/defaults.css                         |    8 ++++++++
 .../as/src/org/apache/flex/core/CSSTextField.as    |   11 ++++++-----
 frameworks/as/src/org/apache/flex/core/UIBase.as   |    8 ++++++--
 .../html/staticControls/beads/TextFieldBeadBase.as |   10 ++++++++++
 4 files changed, 30 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a077336a/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index 64caf16..b503dd5 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -85,6 +85,12 @@ DropDownListList
     ISelectionModel: ClassReference("org.apache.flex.html.staticControls.beads.models.ArraySelectionModel");
 }
 
+Label
+{
+	width: 95;
+	height: 18;
+}
+
 List
 {
 	ISelectionModel: ClassReference("org.apache.flex.html.staticControls.beads.models.ArraySelectionModel");
@@ -104,6 +110,8 @@ TextButton
 TextInput
 {
     ITextInputBead: ClassReference("org.apache.flex.html.staticControls.beads.TextInputWithBorderBead");
+	width: 135;
+	height: 20;
 }
 
 /* HTML5 */

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a077336a/frameworks/as/src/org/apache/flex/core/CSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/CSSTextField.as b/frameworks/as/src/org/apache/flex/core/CSSTextField.as
index 7ffa12b..eb2cc21 100644
--- a/frameworks/as/src/org/apache/flex/core/CSSTextField.as
+++ b/frameworks/as/src/org/apache/flex/core/CSSTextField.as
@@ -29,14 +29,15 @@ package org.apache.flex.core
 		{
 			super();
 		}
-
+		
 		override public function set text(value:String):void
 		{
 			var tf: TextFormat = new TextFormat();
-			tf.font = ValuesManager.valuesImpl.getValue(this, "fontFamily") as String;
-			tf.size = ValuesManager.valuesImpl.getValue(this, "fontSize");
-			tf.color = ValuesManager.valuesImpl.getValue(this, "color");
-			var padding:Object = ValuesManager.valuesImpl.getValue(this, "padding");
+			tf.font = ValuesManager.valuesImpl.getValue(parent, "fontFamily") as String;
+			tf.size = ValuesManager.valuesImpl.getValue(parent, "fontSize");
+			tf.bold = ValuesManager.valuesImpl.getValue(parent, "fontWeight") == "bold";
+			tf.color = ValuesManager.valuesImpl.getValue(parent, "color");
+			var padding:Object = ValuesManager.valuesImpl.getValue(parent, "padding");
 			if (padding != null)
 			{
 				tf.leftMargin = padding;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a077336a/frameworks/as/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/UIBase.as b/frameworks/as/src/org/apache/flex/core/UIBase.as
index 0d93b94..a624eca 100644
--- a/frameworks/as/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/as/src/org/apache/flex/core/UIBase.as
@@ -30,9 +30,11 @@ package org.apache.flex.core
 			super();
 		}
 		
-		private var _width:Number = 0;
+		private var _width:Number;
 		override public function get width():Number
 		{
+			if (isNaN(_width))
+				_width = Number(ValuesManager.valuesImpl.getValue(this, "width"));
 			return _width;
 		}
 		override public function set width(value:Number):void
@@ -48,9 +50,11 @@ package org.apache.flex.core
 			return super.width;
 		}
 		
-		private var _height:Number = 0;
+		private var _height:Number;
 		override public function get height():Number
 		{
+			if (isNaN(_height))
+				_height = Number(ValuesManager.valuesImpl.getValue(this, "height"));
 			return _height;
 		}
 		override public function set height(value:Number):void

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a077336a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
index 4f1c26d..1c4fb0a 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
@@ -18,6 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.staticControls.beads
 {
+	import flash.display.DisplayObject;
 	import flash.display.DisplayObjectContainer;
 	
 	import org.apache.flex.core.CSSTextField;
@@ -56,7 +57,10 @@ package org.apache.flex.html.staticControls.beads
 			_textModel = value.getBeadByType(ITextModel) as ITextModel;
 			textModel.addEventListener("textChange", textChangeHandler);
 			textModel.addEventListener("htmlChange", htmlChangeHandler);
+			textModel.addEventListener("widthChanged", sizeChangeHandler);
+			textModel.addEventListener("heightChanged", sizeChangeHandler);
 			DisplayObjectContainer(value).addChild(_textField);
+			sizeChangeHandler(null);
 			if (textModel.text !== null)
 				text = textModel.text;
 			if (textModel.html !== null)
@@ -96,5 +100,11 @@ package org.apache.flex.html.staticControls.beads
 		{
 			html = textModel.html;
 		}
+		
+		private function sizeChangeHandler(event:Event):void
+		{
+			textField.width = DisplayObject(_strand).width;
+			textField.height = DisplayObject(_strand).height;
+		}
 	}
 }
\ No newline at end of file


Mime
View raw message