royale-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] aharui closed pull request #336: MenuBar related classes and TreeEvent class emulated.
Date Wed, 07 Nov 2018 23:18:19 GMT
aharui closed pull request #336: MenuBar related classes and TreeEvent class emulated.
URL: https://github.com/apache/royale-asjs/pull/336
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index c18bcd294..0f67789ed 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -181,7 +181,6 @@ internal class MXRoyaleClasses
 	import mx.managers.IToolTipManager2; IToolTipManager2;
 	import mx.utils.PopUpUtil; PopUpUtil;
 	import mx.rpc.http.HTTPMultiService; HTTPMultiService;
-	import mx.rpc.http.HTTPServiceWrapper; HTTPServiceWrapper;
 	import mx.messaging.messages.HTTPRequestMessage; HTTPRequestMessage;
 	import mx.messaging.channels.DirectHTTPChannel; DirectHTTPChannel;
 	import mx.messaging.errors.MessageSerializationError; MessageSerializationError;
@@ -190,6 +189,7 @@ internal class MXRoyaleClasses
 	import mx.events.MenuEvent; MenuEvent;
 	import mx.rpc.CallResponder; CallResponder;
 	import mx.rpc.http.Operation; Operation;
+	import mx.events.TreeEvent; TreeEvent;
 	
 
 	COMPILE::JS
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/IListItemRenderer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/IListItemRenderer.as
new file mode 100644
index 000000000..ce4798c9d
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/IListItemRenderer.as
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls.listClasses
+{
+	// import flash.events.IEventDispatcher;
+	import org.apache.royale.events.IEventDispatcher;
+		
+	import mx.core.IDataRenderer;
+	import mx.core.IFlexDisplayObject;
+	import mx.core.IUIComponent;
+	import mx.managers.ILayoutManagerClient;
+	import mx.styles.ISimpleStyleClient;
+	
+	/**
+	 *  Item renderers and item editors for list components must implement 
+	 *  the IListItemRenderer interface.
+	 *  The IListItemRenderer interface is a set of several other interfaces. 
+	 *  It does not define any new class methods or properties. 
+	 *
+	 *  <p>The set of interfaces includes the following:
+	 *  IDataRenderer, IFlexDisplayObject, ILayoutManagerClient,
+	 *  ISimpleStyleClient, IUIComponent.
+	 *  The UIComponent class implements all of these interfaces,
+	 *  except the IDataRenderer interface. 
+	 *  Therefore, if you create a custom item renderer or item editor
+	 *  as a subclass  of the UIComponent class, you only have to implement
+	 *  the IDataRenderer interface and then you can add to the class
+	 *  definition that the class implements IDataRenderer and IListItemRenderer.</p>
+	 *
+	 *	<p>IListItemRenderers are generally dedicated to displaying a particular
+	 *  field from the data provider item and cannot be re-used in other
+	 *  DataGrid columns or in other lists with different fields.  If you want
+	 *  to create a renderer that can be re-used you can also implement
+	 *  IDropInListItemRenderer, and the list will pass more data to
+	 *  the renderer that allows the renderer to be re-used with different
+	 *  data fields.</p>
+	 *
+	 *  <p>Item renderers and item editors are passed data from a list class'
+	 *  data provider using the IDataRenderer interface.
+	 *  Renderers and editors that implement the IDropInListItemRenderer
+	 *  interface get other information from the list class.
+	 *  The item renderer or item editor uses one or both pieces of information
+	 *  to display the data.</p>
+	 *
+	 *  <p>The renderers and editors are often recycled.
+	 *  Once they are created, they may be used again simply by being given
+	 *  a new data and optional <code>listData</code> property.
+	 *  Therefore in your implementation you must make sure that component
+	 *  properties are not assumed to contain their initial, or default values.</p>
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public interface IListItemRenderer extends IDataRenderer, IEventDispatcher,
+		IFlexDisplayObject,
+		ILayoutManagerClient,
+		ISimpleStyleClient, IUIComponent
+	{
+	}
+	
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/events/TreeEvent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/events/TreeEvent.as
new file mode 100644
index 000000000..6d587db3c
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/TreeEvent.as
@@ -0,0 +1,332 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.events
+{
+	// import flash.events.Event;
+		
+	import org.apache.royale.events.Event;
+	import mx.controls.listClasses.IListItemRenderer;
+	
+	/**
+	 *  The TreeEvent class represents the event object passed to the event
+	 *  listener for events that are associated with activities
+	 *  in tree, such as when a tree branch opens or closes.
+	 *
+	 *  @see mx.controls.Tree
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class TreeEvent extends Event
+	{
+		// include "../core/Version.as";
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Class constants
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  The TreeEvent.ITEM_CLOSE event type constant indicates that a tree
+		 *  branch closed or collapsed.
+		 *
+		 *  <p>The properties of the event object for this event type have the
+		 *  following values.
+		 *  Not all properties are meaningful for all kinds of events.
+		 *  See the detailed property descriptions for more information.</p>
+		 * 
+		 *  <table class="innertable">
+		 *     <tr><th>Property</th><th>Value</th></tr>
+		 *     <tr><td><code>itemRenderer</code></td>
+		 *         <td>The ListItemRenderer for the node that closed</td></tr>
+		 *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+		 *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+		 *     <tr><td><code>currentTarget</code></td><td>The Object that defines the
+		 *       event listener that handles the event. For example, if you use
+		 *       <code>myButton.addEventListener()</code> to register an event listener,
+		 *       myButton is the value of the <code>currentTarget</code>. </td></tr>
+		 *     <tr><td><code>triggerEvent</code></td>
+		 *         <td>If the node closed in response to a user action,
+		 *             identifies it as a keyboard action or a mouse action.</td></tr>
+		 *     <tr><td><code>item</code></td><td>the Tree item (node) that closed</td></tr>
+		 *     <tr><td><code>target</code></td><td>The Object that dispatched the event;
+		 *       it is not always the Object listening for the event.
+		 *       Use the <code>currentTarget</code> property to always access the
+		 *       Object listening for the event.</td></tr>
+		 *     <tr><td><code>type</code></td><td>TreeEvent.ITEM_CLOSE</td></tr>
+		 *  </table>
+		 *
+		 *  @eventType itemClose
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static const ITEM_CLOSE:String = "itemClose";
+		
+		/**
+		 *  The TreeEvent.ITEM_OPEN event type constant indicates that a tree
+		 *  branch opened or expanded.
+		 *
+		 *  <p>The properties of the event object for this event type have the
+		 *  following values.
+		 *  Not all properties are meaningful for all kinds of events.
+		 *  See the detailed property descriptions for more information.</p>
+		 * 
+		 *  <table class="innertable">
+		 *     <tr><th>Property</th><th>Value</th></tr>
+		 *     <tr><td><code>itemRenderer</code></td>
+		 *         <td>The ListItemRenderer for the item (node) that opened</td></tr>
+		 *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+		 *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+		 *     <tr><td><code>currentTarget</code></td><td>The Object that defines the
+		 *       event listener that handles the event. For example, if you use
+		 *       <code>myButton.addEventListener()</code> to register an event listener,
+		 *       myButton is the value of the <code>currentTarget</code>. </td></tr>
+		 *     <tr><td><code>triggerEvent</code></td>
+		 *         <td>If the item (node) opened in response to a user action,
+		 *             identifies it as a keyboard action or a mouse action.</td></tr>
+		 *     <tr><td><code>item</code></td><td>the Tree node that opened.</td></tr>
+		 *     <tr><td><code>target</code></td><td>The Object that dispatched the event;
+		 *       it is not always the Object listening for the event.
+		 *       Use the <code>currentTarget</code> property to always access the
+		 *       Object listening for the event.</td></tr>
+		 *     <tr><td><code>type</code></td><td>TreeEvent.ITEM_OPEN</td></tr>
+		 *  </table>
+		 *
+		 *  @eventType itemOpen
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static const ITEM_OPEN:String = "itemOpen";
+		
+		/**
+		 *  The TreeEvent.ITEM_OPENING event type constant is dispatched immediately 
+		 *  before a tree opens or closes.
+		 *
+		 *  <p>The properties of the event object for this event type have the
+		 *  following values.
+		 *  Not all properties are meaningful for all kinds of events.
+		 *  See the detailed property descriptions for more information.</p>
+		 * 
+		 *  <table class="innertable">
+		 *     <tr><th>Property</th><th>Value</th></tr>
+		 *     <tr><td><code>animate</code></td><td>Whether to animate the opening 
+		 *             or closing operation.</td></tr>
+		 *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+		 *     <tr><td><code>cancelable</code></td><td>true</td></tr>
+		 *     <tr><td><code>currentTarget</code></td><td>The Object that defines the
+		 *              event listener that handles the event. For example, if you use
+		 *              <code>myButton.addEventListener()</code> to register an event
+		 *              listener, myButton is the value of the <code>currentTarget</code>.</td></tr>
+		 *     <tr><td><code>dispatchEvent</code></td><td>Whether to dispatch an 
+		 *             <code>ITEM_OPEN</code> or <code>ITEM_CLOSE</code> event
+		 *              after the open or close animation is complete. true</td></tr>
+		 *     <tr><td><code>itemRenderer</code></td>
+		 *         <td>The ListItemRenderer for the item (node) that opened</td></tr>
+		 *     <tr><td><code>item</code></td><td>the Tree node that opened.</td></tr>
+		 *     <tr><td><code>opening</code></td><td>true if the item is opening, false
+		 *             if it is closing.</td></tr>
+		 *     <tr><td><code>target</code></td><td>The Object that dispatched the event;
+		 *       it is not always the Object listening for the event.
+		 *       Use the <code>currentTarget</code> property to always access the
+		 *       Object listening for the event.</td></tr>
+		 *     <tr><td><code>triggerEvent</code></td>
+		 *         <td>If the item opened in response to a user action,
+		 *             identifies it as a keyboard action or a mouse action.</td></tr>
+		 *     <tr><td><code>type</code></td><td>TreeEvent.ITEM_OPENING</td></tr>
+		 *  </table>
+		 *
+		 *  @eventType itemOpening
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static const ITEM_OPENING:String = "itemOpening";
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  Constructor.
+		 *  Normally called by the Flex Tree control; not used in application code.
+		 *
+		 *  @param type The event type; indicates the action that caused the event.
+		 *
+		 *  @param bubbles Specifies whether the event can bubble
+		 *  up the display list hierarchy.
+		 *
+		 *  @param cancelable Specifies whether the behavior associated with the event
+		 *  can be prevented.
+		 *
+		 *  @param item The Tree node (item) to which this event applies.
+		 *
+		 *  @param itemRenderer The item renderer object for the cell.
+		 *
+		 *  @param triggerEvent If the node opened or closed in response to a
+		 *  user action, indicates the type of input action.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function TreeEvent(type:String, bubbles:Boolean = false,
+								  cancelable:Boolean = false,
+								  item:Object = null,
+								  itemRenderer:IListItemRenderer = null,
+								  triggerEvent:Event = null)
+		{
+			super(type, bubbles, cancelable);
+			
+			this.item = item;
+			this.itemRenderer = itemRenderer;
+			this.triggerEvent = triggerEvent;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Properties
+		//
+		//--------------------------------------------------------------------------
+		
+		//----------------------------------
+		//  animate
+		//----------------------------------
+		
+		/**
+		 *  Whether to animate an opening or closing operation; used for 
+		 *  ITEM_OPENING type events only.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var animate:Boolean;
+		
+		//----------------------------------
+		//  dispatchEvent
+		//----------------------------------
+		
+		/**
+		 *  Whether to dispatch an event (<code>ITEM_OPEN</code> or 
+		 *  <code>ITEM_CLOSE</code>) after the open or close animation 
+		 *  is complete. Used for ITEM_OPENING type events only.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var dispatchEvent:Boolean;
+		
+		//----------------------------------
+		//  item
+		//----------------------------------
+		
+		/**
+		 *  Storage for the item property.
+		 *  If you populate the Tree from XML data, access
+		 *  the properties for the node as
+		 *  <code>event.item.&#64;<i>attribute_name</i></code>.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var item:Object;
+		
+		//----------------------------------
+		//  itemRenderer
+		//----------------------------------
+		
+		/**
+		 *  The ListItemRenderer for the node that closed or opened.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var itemRenderer:IListItemRenderer;
+		
+		//----------------------------------
+		//  opening
+		//----------------------------------
+		
+		/**
+		 *  Used for an <code>ITEM_OPENING</code> type events only.
+		 *  Indicates whether the item 
+		 *  is opening <code>true</code>, or closing <code>false</code>.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var opening:Boolean;
+		
+		//----------------------------------
+		//  triggerEvent
+		//----------------------------------
+		
+		/**
+		 *  The low level MouseEvent or KeyboardEvent that triggered this
+		 *  event or <code>null</code> if this event was triggered programatically.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var triggerEvent:Event;
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden methods: Event
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 */
+		COMPILE::SWF
+		override public function clone():Event
+		{
+			return new TreeEvent(type, bubbles, cancelable,
+				item, itemRenderer, triggerEvent);
+		}
+	}
+	
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPServiceWrapper.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPServiceWrapper.as
deleted file mode 100644
index 5962cd781..000000000
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPServiceWrapper.as
+++ /dev/null
@@ -1,30 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-
-package mx.rpc.http
-{
-	// Ref : https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/com/adobe/fiber/services/wrapper/HTTPServiceWrapper.html#methodSummary
-	public class HTTPServiceWrapper extends HTTPMultiService
-	{
-		
-		public var _serviceControl:mx.rpc.http.HTTPMultiService;
-		
-		
-	}
-}
\ No newline at end of file
diff --git a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
index af778722b..cb436d4b1 100644
--- a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
+++ b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
@@ -103,5 +103,7 @@
 	<component id="HTTPService" class="mx.rpc.http.mxml.HTTPService" lookupOnly="true"/>
 	<component id="GridItemRenderer" class="spark.components.gridClasses.GridItemRenderer"/>
 	<component id="Parallel" class="mx.effects.Parallel" lookupOnly="true"/>
+	<component id="BasicLayout" class="spark.layouts.BasicLayout"/>
+	<component id="FormLayout" class="spark.layouts.FormLayout"/>
     
 </componentPackage>
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as b/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as
index 9e5a6b895..46205f92a 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as
@@ -70,6 +70,7 @@ internal class SparkRoyaleClasses
 	import spark.components.Form; Form;
 	import spark.components.FormItem; FormItem;
 	import spark.core.IDisplayText; IDisplayText;
+	import spark.events.PopUpEvent; PopUpEvent;
 	
 }
 
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/gridClasses/GridItemRenderer.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/gridClasses/GridItemRenderer.as
index 54d0c7c9c..f1d958a1d 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/gridClasses/GridItemRenderer.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/gridClasses/GridItemRenderer.as
@@ -26,13 +26,13 @@ package spark.components.gridClasses
 		import flash.geom.Rectangle;
 	}
 		
-		COMPILE::JS {
-			import org.apache.royale.events.Event;
-			import org.apache.royale.geom.Point;
-			import org.apache.royale.geom.Rectangle;
-		}	
-		
-		import mx.core.IToolTip;
+	COMPILE::JS {
+		import org.apache.royale.events.Event;
+		import org.apache.royale.geom.Point;
+		import org.apache.royale.geom.Rectangle;
+	}	
+	
+	import mx.core.IToolTip;
 	import mx.core.IUIComponent;
 	import mx.core.LayoutDirection;
 	import mx.core.mx_internal;
@@ -175,7 +175,7 @@ package spark.components.gridClasses
 		 */    
 		static mx_internal function initializeRendererToolTip(renderer:IGridItemRenderer):void
 		{
-			const toolTipClient:IToolTipManagerClient = renderer as IToolTipManagerClient;
+			/*const toolTipClient:IToolTipManagerClient = renderer as IToolTipManagerClient;
 			if (!toolTipClient)
 				return;
 			
@@ -185,7 +185,7 @@ package spark.components.gridClasses
 			if (!dataTip && showDataTips)
 				toolTipClient.toolTip = "<dataTip>";
 			else if (dataTip && !showDataTips)
-				toolTipClient.toolTip = null;
+				toolTipClient.toolTip = null;*/
 		}
 		
 		/**
@@ -210,7 +210,7 @@ package spark.components.gridClasses
 		 *  IUIComponent.
 		 */ 
 		static mx_internal function toolTipShowHandler(event:ToolTipEvent):void
-		{
+		{/*
 			var toolTip:IToolTip = event.toolTip;
 			
 			const renderer:IGridItemRenderer = event.currentTarget as IGridItemRenderer;
@@ -234,18 +234,18 @@ package spark.components.gridClasses
 				renderer.getLayoutBoundsWidth(),
 				renderer.getLayoutBoundsHeight());
 			
-			/*const scrollR:Rectangle = renderer.grid.scrollRect;
+			const scrollR:Rectangle = renderer.grid.scrollRect;
 			if (scrollR)
-				rendererR = rendererR.intersection(scrollR);  // exposed renderer b*/
+				rendererR = rendererR.intersection(scrollR);  // exposed renderer b
 			
 			if ((rendererR.height == 0) || (rendererR.width == 0))
 				return;
 			
 			// Determine if the toolTip needs to be adjusted for RTL layout.
-			const mirror:Boolean = false; /*renderer.layoutDirection == LayoutDirection.RTL;*/
+			const mirror:Boolean = false; *//*renderer.layoutDirection == LayoutDirection.RTL;*/
 			
 			// Lazily compute the tooltip text and recalculate its width.
-			toolTip.text = renderer.column.itemToDataTip(renderer.data);
+			/*toolTip.text = renderer.column.itemToDataTip(renderer.data);
 			ToolTipManager.sizeTip(toolTip);
 			
 			// We need to position the tooltip at same x coordinate, 
@@ -255,7 +255,7 @@ package spark.components.gridClasses
 			// x,y: tooltip's location relative to the renderer's layout bounds
 			// Assume there's no scaling in the coordinate space between renderer.width and toolTip.width 
 			const x:int =  mirror ? (renderer.width - toolTip.width) : (rendererR.x - renderer.getLayoutBoundsX());
-			const y:int = rendererR.y - renderer.getLayoutBoundsY() + ((rendererR.height - toolTip.height) / 2);
+			const y:int = rendererR.y - renderer.getLayoutBoundsY() + ((rendererR.height - toolTip.height) / 2);*/
 			
 			/*var pt:Point = PopUpUtil.positionOverComponent(DisplayObject(uiComp),
 			uiComp.systemManager,
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/events/PopUpEvent.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/events/PopUpEvent.as
new file mode 100644
index 000000000..b326be839
--- /dev/null
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/events/PopUpEvent.as
@@ -0,0 +1,195 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.events
+{
+	
+	// import flash.events.Event;
+	import org.apache.royale.events.Event;
+	
+	/**
+	 *  The PopUpEvent class represents an event dispatched by the SkinnablePopUpContainer.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 2.5
+	 *  @productversion Flex 4.5
+	 */
+	public class PopUpEvent extends Event
+	{   
+		//--------------------------------------------------------------------------
+		//
+		//  Class constants
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  The PopUpEvent.OPEN constant defines the value of the 
+		 *  <code>type</code> property of the PopUpEvent object for an
+		 *  <code>open</code> event.
+		 *
+		 *  <p>The properties of the event object have the following values:</p>
+		 * 
+		 *  <table class="innertable">
+		 *     <tr><th>Property</th><th>Value</th></tr>
+		 *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+		 *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+		 *     <tr><td><code>commit</code></td><td>Not used</td></tr>
+		 *     <tr><td><code>currentTarget</code></td><td>The Object that defines the 
+		 *       event listener that handles the event. For example, if you use 
+		 *       <code>myButton.addEventListener()</code> to register an event listener, 
+		 *       myButton is the value of the <code>currentTarget</code>. </td></tr>
+		 *     <tr><td><code>Data</code></td><td>Not used</td></tr>
+		 *     <tr><td><code>target</code></td><td>The Object that dispatched the event; 
+		 *       it is not always the Object listening for the event. 
+		 *       Use the <code>currentTarget</code> property to always access the 
+		 *       Object listening for the event.</td></tr>
+		 *     <tr><td><code>Type</code></td><td>PopUpEvent.OPEN</td></tr>
+		 *  </table>
+		 *
+		 *  @eventType open
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public static const OPEN:String = "open";
+		
+		/**
+		 *  The PopUpEvent.CLOSE constant defines the value of the 
+		 *  <code>type</code> property of the PopUpEvent object for an
+		 *  <code>close</code> event.
+		 *
+		 *  <p>The properties of the event object have the following values:</p>
+		 * 
+		 *  <table class="innertable">
+		 *     <tr><th>Property</th><th>Value</th></tr>
+		 *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+		 *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+		 *     <tr><td><code>commit</code></td><td>Specifies whether the listener 
+		 *       should commit the data.</td></tr>
+		 *     <tr><td><code>currentTarget</code></td><td>The Object that defines the 
+		 *       event listener that handles the event. For example, if you use 
+		 *       <code>myButton.addEventListener()</code> to register an event listener, 
+		 *       myButton is the value of the <code>currentTarget</code>. </td></tr>
+		 *     <tr><td><code>Data</code></td><td>Any data returned to the application 
+		 *       from the SkinnablePopUpContainer.</td></tr>
+		 *     <tr><td><code>target</code></td><td>The Object that dispatched the event; 
+		 *       it is not always the Object listening for the event. 
+		 *       Use the <code>currentTarget</code> property to always access the 
+		 *       Object listening for the event.</td></tr>
+		 *     <tr><td><code>Type</code></td><td>PopUpEvent.OPEN</td></tr>
+		 *  </table>
+		 *
+		 *  @eventType close
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public static const CLOSE:String = "close";
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  Constructor.
+		 *
+		 *  @param type The event type; indicates the action that caused the event.
+		 *
+		 *  @param bubbles Specifies whether the event can bubble up the display list hierarchy.
+		 *
+		 *  @param cancelable Specifies whether the behavior associated with the event can be prevented.
+		 * 
+		 *  @param commit Specifies whether the listener should commit the data from the SkinnablePopUpContainer.
+		 *  Only used with the <code>PopUpEvent.CLOSE</code> event.
+		 * 
+		 *  @param data The data to commit. Only used with the <code>PopUpEvent.CLOSE</code> event.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public function PopUpEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, 
+								   commit:Boolean = false, data:* = undefined)
+		{
+			super(type, bubbles, cancelable);
+			this.commit = commit;
+			this.data = data;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Properties
+		//
+		//--------------------------------------------------------------------------
+		
+		//----------------------------------
+		//  commit
+		//----------------------------------
+		
+		/**
+		 *  Specifies whether the event listener should commit the data
+		 *  returned in the <code>data</code> property.
+		 *  Only used with <code>PopUpEvent.CLOSE</code> event.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public var commit:Boolean;
+		
+		//----------------------------------
+		//  data
+		//----------------------------------
+		
+		/**
+		 *  The data to commit.
+		 *  Only used with <code>PopUpEvent.CLOSE</code> event.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public var data:*;
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden methods: Event
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 */
+		COMPILE::SWF { override } public function clone():Event
+		{
+			return new PopUpEvent(type, bubbles, cancelable, commit, data);
+		}
+	}
+	
+}
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/FormItemLayout.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/FormItemLayout.as
new file mode 100644
index 000000000..58778ac98
--- /dev/null
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/FormItemLayout.as
@@ -0,0 +1,107 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.layouts
+{
+	import mx.containers.utilityClasses.ConstraintColumn;
+	import mx.core.mx_internal;
+	
+	import spark.components.supportClasses.GroupBase;
+	
+	use namespace mx_internal;
+	
+	/**
+	 *  The FormItemLayout is used by FormItems to provide a constraint based layout.
+	 *  Elements using FormItemLayout within a FormLayout are aligned along columns.  
+	 * 
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 2.5
+	 *  @productversion Flex 4.5
+	 */ 
+	public class FormItemLayout //extends ConstraintLayout
+	{
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  Constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */
+		public function FormItemLayout()
+		{
+			super();
+		}
+		
+		private var layoutColumnWidths:Vector.<Number> = null;
+		
+		/**
+		 *  @private
+		 *  Only resize columns and rows if setLayoutColumnWidths hasn't been called.
+		 */
+		/*override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{
+			checkUseVirtualLayout();
+			
+			var layoutTarget:GroupBase = target;
+			if (!layoutTarget)
+				return;
+			
+			// need to parse constraints and rows may resize.
+			measureAndPositionColumnsAndRows(unscaledWidth, unscaledHeight);
+			
+			if (layoutColumnWidths)
+				setColumnWidths(layoutColumnWidths);
+			
+			layoutContent(unscaledWidth, unscaledHeight);
+		}*/
+		
+		/**
+		 *  @private
+		 *  Used by layout to get the measured column widths
+		 */
+		public function getMeasuredColumnWidths():Vector.<Number>
+		{
+			return null; //measureColumns();
+		}
+		
+		/**
+		 *  @private
+		 *  Used by layout to set the column widths for updateDisplayList. Must
+		 *  call this if you want to override the default widths of the columns.
+		 */
+		public function setLayoutColumnWidths(value:Vector.<Number>):void
+		{
+			// apply new measurements and position the columns again.
+			layoutColumnWidths = value;
+			
+			// setColumnWidths(layoutColumnWidths);
+			
+			// target.invalidateDisplayList();
+		}
+		
+	}
+}
\ No newline at end of file
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/FormLayout.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/FormLayout.as
new file mode 100644
index 000000000..5de74d731
--- /dev/null
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/FormLayout.as
@@ -0,0 +1,449 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.layouts
+{
+	import mx.containers.utilityClasses.ConstraintColumn;
+	import mx.containers.utilityClasses.Flex;
+	import mx.core.ILayoutElement;
+	import mx.core.mx_internal;
+	
+	import spark.components.supportClasses.GroupBase;
+	import spark.components.supportClasses.SkinnableComponent;
+	import spark.layouts.supportClasses.LayoutBase;
+	
+	use namespace mx_internal;
+	
+	/**
+	 *  The FormLayout class defines the default layout for Spark Form skins.
+	 *  FormLayout provides a vertical layout for the child FormItem containers in the Form.
+	 *  
+	 *  If any of the child containers uses a FormItemLayout, FormLayout will
+	 *  align the ConstraintColumns of each child.
+	 *  The number of columns across children should be the same, and the columns
+	 *  should have the same type of width setting.
+	 *  For example, if the first child's second column has a percent width, then the 
+	 *  second child's second column should also be a percent width.
+	 *
+	 *  <p><b>Note</b>: Only use the FormLayout class with the Spark Form container. 
+	 *  Do not use it to lay out the contents of any other container.</p>
+	 *
+	 *  @see spark.components.Form
+	 *  @see spark.components.FormHeading
+	 *  @see spark.components.FormItem
+	 *  @see spark.layouts.FormItemLayout
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 2.5
+	 *  @productversion Flex 4.5
+	 */
+	public class FormLayout extends VerticalLayout
+	{
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 *  Return the sum of all of the column widths
+		 */
+		private static function calculateColumnWidthsSum(columnWidths:Vector.<Number>):Number
+		{
+			if (columnWidths == null)
+				return 0;
+			
+			var sum:Number = 0;
+			var columnWidthsLength:int = columnWidths.length;
+			for (var i:int = 0; i < columnWidthsLength; i++)
+			{
+				sum += columnWidths[i];
+			}
+			
+			return sum;
+		}
+		
+		/**
+		 *  @private
+		 *  Look for the layout property of several known types. 
+		 *  For Form, we want the content layout. 
+		 *  For SkinnableComponent, we want the skin's layout. 
+		 *  For GroupBase, we get the layout (it has no skin).
+		 *  If that layout is an IFormItemLayout, then it will
+		 *  participate in the FormLayout's column alignment
+		 */ 
+		private static function getElementLayout(elt:ILayoutElement):LayoutBase
+		{
+			var layout:LayoutBase = null;
+			
+			if (elt is SkinnableComponent)
+			{
+				var skin:GroupBase = SkinnableComponent(elt).skin as GroupBase;
+				if (skin)
+					layout = skin.layout as LayoutBase;
+			}
+			else if (elt is GroupBase)
+			{
+				layout = GroupBase(elt).layout as LayoutBase;
+			}
+			
+			return layout;
+		}
+		
+		/**
+		 *  @private
+		 *  Returns a vector containing the layout elements that have a FormItemLayout and
+		 *  thus are participating in the Form's column alignment step.
+		 */ 
+		private static function getFormItems(layoutTarget:GroupBase):Vector.<ILayoutElement>
+		{
+			if (!layoutTarget)
+				return new Vector.<ILayoutElement>();
+			
+			const nElts:int = layoutTarget.numElements;
+			var elt:ILayoutElement;
+			var formItems:Vector.<ILayoutElement> = new Vector.<ILayoutElement>();
+			
+			for (var i:int = 0; i < nElts; i++)
+			{
+				elt = layoutTarget.getElementAt(i) as ILayoutElement;
+				if (!elt.includeInLayout)
+					continue;
+				
+				if (getElementLayout(elt) is FormItemLayout)
+					formItems.push(elt);
+			}
+			
+			return formItems;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  Constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 2.5
+		 *  @productversion Flex 4.5
+		 */                  
+		public function FormLayout()
+		{
+			super();
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Properties
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 */
+		override public function set target(value:GroupBase):void
+		{
+			if (target == value)
+				return;
+			
+			// reset FormItemLayout columns when value is null.
+			// target is set to null in GroupBase when swapping layouts.
+			if (value == null)
+			{
+				var layout:LayoutBase;
+				const nElts:int = target.numElements;
+				var elt:ILayoutElement
+				
+				for (var i:int = 0; i < nElts; i++)
+				{ 
+					elt = target.getElementAt(i) as ILayoutElement;
+					if (!elt.includeInLayout)
+						continue;
+					
+					layout = getElementLayout(elt);
+					
+					// Reset the column widths of each FormItemLayout
+					if (layout is FormItemLayout)
+						(layout as FormItemLayout).setLayoutColumnWidths(null);
+				}
+			}
+			
+			super.target = value;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  IFormLayout Implementation
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 *  Overridden column widths value to be used.
+		 */
+		private var columnWidthsOverride:Vector.<Number>;
+		
+		/**
+		 *  @private
+		 */
+		public function getMeasuredColumnWidths():Vector.<Number>
+		{
+			const layoutTarget:GroupBase = target;
+			if (!layoutTarget)
+				return null;
+			
+			var formItems:Vector.<ILayoutElement> = getFormItems(layoutTarget);
+			
+			return calculateColumnMaxWidths(formItems);
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function setLayoutColumnWidths(value:Vector.<Number>):void
+		{
+			columnWidthsOverride = value;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden Methods
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 */
+		override public function measure():void
+		{
+			super.measure();
+			
+			const layoutTarget:GroupBase = target;
+			if (!layoutTarget)
+				return;
+			
+			var formItems:Vector.<ILayoutElement> = getFormItems(layoutTarget);
+			var hPadding:Number = paddingLeft + paddingRight;
+			
+			// Calculate preferred width based on columns
+			var columnMaxWidths:Vector.<Number> = columnWidthsOverride == null ? calculateColumnMaxWidths(formItems) : columnWidthsOverride;
+			var formWidth:Number = calculateColumnWidthsSum(columnMaxWidths) + hPadding;
+			
+			// Calculate minimum preferred width based on columns
+			constrainPercentColumnWidths(columnMaxWidths, 0, formItems);
+			var formMinWidth:Number = calculateColumnWidthsSum(columnMaxWidths) + hPadding;
+			
+			// use measured column widths to set Form's measuredWidth
+			// Assumes measuredWidth is already set in super.measure()
+			layoutTarget.measuredWidth = Math.max(formWidth, layoutTarget.measuredWidth);
+			layoutTarget.measuredMinWidth = Math.max(formMinWidth, layoutTarget.measuredMinWidth);
+		}
+		
+		/**
+		 *  @private
+		 */
+		override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{            
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+			
+			const layoutTarget:GroupBase = target;
+			if (!layoutTarget)
+				return;
+			
+			var formItems:Vector.<ILayoutElement> = getFormItems(layoutTarget);
+			
+			// Need to get the max column widths again because they might have changed
+			// due to resolution of certain constraints
+			var columnMaxWidths:Vector.<Number> = (columnWidthsOverride == null) ? calculateColumnMaxWidths(formItems) : columnWidthsOverride;
+			var hPadding:Number = paddingLeft + paddingRight;
+			
+			if (columnMaxWidths.length > 0)
+			{
+				// Adjust percent size columns to fit in the Form's width
+				constrainPercentColumnWidths(columnMaxWidths, unscaledWidth - hPadding, formItems);
+				
+				for each (var formItem:ILayoutElement in formItems)
+				{
+					// Force each form item to use the max column widths
+					var fiLayout:FormItemLayout = getElementLayout(formItem) as FormItemLayout;
+					fiLayout.setLayoutColumnWidths(columnMaxWidths);
+				}
+				
+				// Recalculate contentWidth; contentHeight already includes padding.
+				var contentWidth:Number = calculateColumnWidthsSum(columnMaxWidths);
+				layoutTarget.setContentSize(contentWidth + hPadding, layoutTarget.contentHeight);
+			}
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Methods
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 *  Iterate through all of the form items (elements with a FormItemLayout layout)
+		 *  and calculate the maximum width for each column.
+		 * 
+		 *  If a column is flexible (has percentWidth), it is treated the same as a content
+		 *  width column.
+		 *  
+		 *  @param formItems Vector of items with a FormItemLayout.
+		 *  
+		 *  @return A vector of the maximum widths for the columns of form items.
+		 */
+		private function calculateColumnMaxWidths(formItems:Vector.<ILayoutElement>):Vector.<Number>
+		{
+			// TODO (klin): Add support for columns with different types of widths across different
+			// form items. This would require additional parameter of availableWidth.
+			if (formItems.length == 0)
+				return new Vector.<Number>();
+			
+			var columnMaxWidths:Vector.<Number> = new Vector.<Number>();
+			var formItem:ILayoutElement;
+			var fiLayout:FormItemLayout;
+			var lastColumnCount:Number = NaN;
+			
+			// Find the preferred column widths for each form item and calculate the max.
+			for each (formItem in formItems)
+			{
+				fiLayout = getElementLayout(formItem) as FormItemLayout;
+				
+				var colWidths:Vector.<Number> = fiLayout.getMeasuredColumnWidths();
+				
+				if (isNaN(lastColumnCount))
+					lastColumnCount = colWidths.length;
+				
+				if (columnMaxWidths.length == 0)
+				{
+					for (var j:int = 0; j < colWidths.length; j++)
+						columnMaxWidths[j] = 0;
+				}
+				
+				// TODO (jszeto): grab this error message from a resource bundle
+				if (lastColumnCount != colWidths.length)
+					throw new Error("The Form must have form items with the same number of constraint columns");
+				
+				for (var k:int = 0; k < colWidths.length; k++)
+				{
+					columnMaxWidths[k] = Math.max(columnMaxWidths[k], colWidths[k]);
+				}
+			}
+			
+			return columnMaxWidths;
+		}
+		
+		/**
+		 *  @private
+		 *  Adjusts the widths of percent size columns to fill the constrainedWidth.
+		 *  This method updates the provided column widths vector in place.
+		 *  
+		 *  The percent size column widths are first reset to their minimum width. 
+		 *  If the given column widths from the content and fixed size columns already
+		 *  fill the available width, then the percent size column widths stay at their
+		 *  minimum width. Otherwise, the remaining width is distributed to the percent 
+		 *  size columns based on the ratio of the percentWidth to the sum of all the 
+		 *  percent widths.
+		 */
+		private function constrainPercentColumnWidths(colWidths:Vector.<Number>, constrainedWidth:Number, formItems:Vector.<ILayoutElement>):void
+		{/*
+			if (formItems.length == 0)
+				return;
+			
+			// TODO (klin): What happens when the form items have different types of columns?
+			const fiLayout:FormItemLayout = getElementLayout(formItems[0]) as FormItemLayout;
+			const constraintColumns:Vector.<ConstraintColumn> = fiLayout.constraintColumns;
+			const numCols:int = constraintColumns.length;
+			var col:ConstraintColumn;
+			var childInfoArray:Array*/ /* of ColumnFlexChildInfo *//* = [];
+			var childInfo:ColumnFlexChildInfo;
+			var remainingWidth:Number = constrainedWidth;
+			var percentMinWidths:Number = 0;
+			var totalPercent:Number = 0;
+			
+			// Set percent width columns back to minWidth and
+			// find the remaining width.
+			for (var i:int = 0; i < numCols; i++)
+			{
+				col = constraintColumns[i];
+				if (!isNaN(col.percentWidth))
+				{
+					colWidths[i] = (!isNaN(col.minWidth)) ? Math.ceil(Math.max(col.minWidth, 0)) : 0;
+					percentMinWidths += colWidths[i];
+					totalPercent += col.percentWidth;
+					
+					// Fill childInfoArray for distributing the width.
+					childInfo = new ColumnFlexChildInfo();
+					childInfo.index = i;
+					childInfo.percent = col.percentWidth;
+					childInfo.min = col.minWidth;
+					childInfo.max = col.maxWidth;
+					childInfoArray.push(childInfo);
+				}
+				else
+				{
+					remainingWidth -= colWidths[i];
+				}
+			}
+			
+			// If there's space remaining, distribute the width to the percent size
+			// columns based on their ratio of percentWidth to sum of all the percentWidths.
+			if (remainingWidth > percentMinWidths)
+			{
+				Flex.flexChildrenProportionally(constrainedWidth, 
+					remainingWidth,
+					totalPercent,
+					childInfoArray);
+				
+				var roundOff:Number = 0;
+				for each (childInfo in childInfoArray)
+				{
+					// Make sure the calculated widths are rounded to pixel boundaries
+					var colWidth:Number = Math.round(childInfo.size + roundOff);
+					roundOff += childInfo.size - colWidth;
+					
+					colWidths[childInfo.index] = colWidth;
+					
+					remainingWidth -= colWidth;
+				}
+				// TODO (klin): What do we do if there's remainingWidth after all this?
+			}*/
+		}
+	}
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Helper class: ColumnFlexChildInfo
+//
+////////////////////////////////////////////////////////////////////////////////
+
+import mx.containers.utilityClasses.FlexChildInfo;
+
+class ColumnFlexChildInfo extends FlexChildInfo
+{
+	public var index:int;
+}
\ No newline at end of file


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message