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-sdk] [refs/heads/develop] - FLEX13036 fix nestLevel in containers with contentpane
Date Fri, 20 Jun 2014 17:02:53 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/develop 780d16a95 -> 3eb9d6d5a


FLEX13036 fix nestLevel in containers with contentpane


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

Branch: refs/heads/develop
Commit: db1bfbec58e0d2696259818a412c17024409d00e
Parents: 780d16a
Author: Alex Harui <aharui@apache.org>
Authored: Wed Jun 18 21:16:17 2014 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Jun 18 21:16:17 2014 -0700

----------------------------------------------------------------------
 frameworks/projects/mx/src/mx/core/Container.as | 45 ++++++++++++++++++++
 1 file changed, 45 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/db1bfbec/frameworks/projects/mx/src/mx/core/Container.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mx/src/mx/core/Container.as b/frameworks/projects/mx/src/mx/core/Container.as
index c3f7d91..0953233 100644
--- a/frameworks/projects/mx/src/mx/core/Container.as
+++ b/frameworks/projects/mx/src/mx/core/Container.as
@@ -44,6 +44,7 @@ import mx.controls.HScrollBar;
 import mx.controls.VScrollBar;
 import mx.controls.listClasses.IListItemRenderer;
 import mx.controls.scrollClasses.ScrollBar;
+import mx.core.IUITextField;
 import mx.events.ChildExistenceChangedEvent;
 import mx.events.FlexEvent;
 import mx.events.IndexChangedEvent;
@@ -4080,6 +4081,50 @@ public class Container extends UIComponent
         }
     }
 
+	/**
+	 *  @private
+	 */
+	override public function set nestLevel(value:int):void
+	{
+		var oldValue:int = super.nestLevel;
+		
+		super.nestLevel = value;
+		if (contentPane)
+		{
+			// If my parent hasn't been attached to the display list, then its nestLevel
+			// will be zero.  If it tries to set my nestLevel to 1, ignore it.  We'll
+			// update nest levels again after the parent is added to the display list.
+			if (value == 1)
+				return;
+			
+			// Also punt if the new value for nestLevel is the same as my current value.
+			// TODO: (aharui) add early exit if nestLevel isn't changing
+			if (value > 1 && oldValue != value)
+				value ++;
+			else if (value == 0)
+				value = 0;
+			else
+				value ++;
+			
+			var n:int = contentPane.numChildren;
+			for (var i:int = 0; i < n; i++)
+			{
+				var ui:ILayoutManagerClient  = contentPane.getChildAt(i) as ILayoutManagerClient;
+				if (ui)
+				{
+					ui.nestLevel = value;
+				}
+				else
+				{
+					var textField:IUITextField = contentPane.getChildAt(i) as IUITextField;
+					
+					if (textField)
+						textField.nestLevel = value;
+				}
+			}
+		}
+	}
+	
     //--------------------------------------------------------------------------
     //
     //  Methods: Deferred instantiation


Mime
View raw message