flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [1/2] git commit: [flex-asjs] [refs/heads/develop] - Updated Alert, SimpleAlert, and Panel to have their beads add Border and Background beads if they find styles that need them. This is how Container does it.
Date Fri, 21 Jun 2013 21:20:22 GMT
Updated Branches:
  refs/heads/develop 2c8fa396b -> c7d57650e


Updated Alert, SimpleAlert, and Panel to have their beads add Border and Background beads
if they find styles that need them. This is how Container does it.


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

Branch: refs/heads/develop
Commit: ffb4c73ad8afa83a819e6331bded569af994f361
Parents: 2c8fa39
Author: Peter Ent <pent@apache.org>
Authored: Fri Jun 21 17:19:01 2013 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Fri Jun 21 17:19:01 2013 -0400

----------------------------------------------------------------------
 .../apache/flex/html/staticControls/Alert.as    |  6 -----
 .../flex/html/staticControls/SimpleAlert.as     |  6 -----
 .../flex/html/staticControls/beads/AlertBead.as | 26 ++++++++++++++++++++
 .../flex/html/staticControls/beads/PanelBead.as |  3 ---
 .../staticControls/beads/SimpleAlertBead.as     | 24 ++++++++++++++++++
 5 files changed, 50 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffb4c73a/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as b/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
index 4da5fef..372dcbe 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
@@ -99,12 +99,6 @@ package org.apache.flex.html.staticControls
 		
 		public function initSkin():void
 		{
-			if( getBeadByType(IBackgroundBead) == null ) {
-				addBead( new (ValuesManager.valuesImpl.getValue(this, "iBackgroundBead")) as IBead);
-			}
-			if( getBeadByType(IBorderBead) == null ) {
-				addBead(new (ValuesManager.valuesImpl.getValue(this, "iBorderBead")) as IBead);
-			}
 			if( getBeadByType(IAlertBead) == null ) {
 				addBead(new (ValuesManager.valuesImpl.getValue(this, "iAlertBead")) as IBead);
 			}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffb4c73a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as b/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
index 140afda..656b2d0 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
@@ -66,12 +66,6 @@ package org.apache.flex.html.staticControls
 		
 		public function initSkin():void
 		{
-			if( getBeadByType(IBackgroundBead) == null ) {
-				addBead( new (ValuesManager.valuesImpl.getValue(this, "iBackgroundBead")) as IBead);
-			}
-			if( getBeadByType(IBorderBead) == null ) {
-				addBead(new (ValuesManager.valuesImpl.getValue(this, "iBorderBead")) as IBead);
-			}
 			if( getBeadByType(ISimpleAlertBead) == null ) {
 				addBead(new (ValuesManager.valuesImpl.getValue(this, "iAlertBead")) as IBead);
 			}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffb4c73a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
index 31bbc21..88a5289 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
@@ -19,10 +19,12 @@
 package org.apache.flex.html.staticControls.beads
 {
 	import org.apache.flex.core.IAlertModel;
+	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IMeasurementBead;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.UIMetrics;
+	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.createjs.staticControls.Label;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
@@ -51,6 +53,30 @@ package org.apache.flex.html.staticControls.beads
 		{
 			_strand = value;
 			
+			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
+			var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
+			if (backgroundColor != null || backgroundImage != null)
+			{
+				if (value.getBeadByType(IBackgroundBead) == null)
+					value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
				
+			}
+			
+			var borderStyle:String;
+			var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
+			if (borderStyles is Array)
+			{
+				borderStyle = borderStyles[1];
+			}
+			if (borderStyle == null)
+			{
+				borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
+			}
+			if (borderStyle != null && borderStyle != "none")
+			{
+				if (value.getBeadByType(IBorderBead) == null)
+					value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);

+			}
+			
 			var flags:uint = IAlertModel(UIBase(_strand).model).flags;
 			if( flags & Alert.OK ) {
 				_okButton = new TextButton();

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffb4c73a/frameworks/as/src/org/apache/flex/html/staticControls/beads/PanelBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/PanelBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/PanelBead.as
index 80a59c7..ffac85d 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/PanelBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/PanelBead.as
@@ -144,9 +144,6 @@ package org.apache.flex.html.staticControls.beads
 			
 			UIBase(_strand).height = metrics.top + metrics.bottom + titleBar.height + contentArea.height
+
 				(controlBar ? controlBar.height : 0);
-			
-			//IEventDispatcher(_strand).dispatchEvent(new Event('widthChanged'));
-			//IEventDispatcher(_strand).dispatchEvent(new Event('heightChanged'));
 		}
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffb4c73a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
index 3d65868..ab482f5 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
@@ -52,6 +52,30 @@ package org.apache.flex.html.staticControls.beads
 		{
 			_strand = value;
 			
+			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
+			var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
+			if (backgroundColor != null || backgroundImage != null)
+			{
+				if (value.getBeadByType(IBackgroundBead) == null)
+					value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
				
+			}
+			
+			var borderStyle:String;
+			var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
+			if (borderStyles is Array)
+			{
+				borderStyle = borderStyles[1];
+			}
+			if (borderStyle == null)
+			{
+				borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
+			}
+			if (borderStyle != null && borderStyle != "none")
+			{
+				if (value.getBeadByType(IBorderBead) == null)
+					value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);

+			}
+			
 			var model:IAlertModel = _strand.getBeadByType(IAlertModel) as IAlertModel;
 			model.addEventListener("messageChange",handleMessageChange);
 			model.addEventListener("htmlMessageChange",handleMessageChange);


Mime
View raw message