flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cframp...@apache.org
Subject svn commit: r1370028 [40/43] - in /incubator/flex/whiteboard/cframpton/adobe.next: ./ frameworks/ frameworks/projects/advancedgrids/src/mx/collections/ frameworks/projects/advancedgrids/src/mx/controls/ frameworks/projects/airframework/src/mx/managers/...
Date Mon, 06 Aug 2012 21:26:02 GMT
Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemEditor.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemEditor.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemEditor.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemEditor.as Mon Aug  6 21:25:54 2012
@@ -190,5 +190,28 @@ public interface IGridItemEditor extends
      */  
     function save():Boolean;
 
+    /**
+     *  Called by the DataGrid when an open editor is being closed without 
+     *  saving the data in the editor. Closing the editor may be 
+     *  prevented by returning <code>false</code>
+     * .  
+     *  <p>Do not call this method directly. 
+     *  It should only be called by the control hosting the item editor.
+     *  To close the editor without saving its data, call the 
+     *  <code>endItemEditorSession()</code> method with the <code>cancel</code>
+     *  parameter set to <code>true</code>.</p>
+     *
+     *  @return <code>true</code> to close the editor without saving its data. 
+     *  Return <code>false</code> to prevent the editor from closing.
+     *  
+     *  @see spark.components.DataGrid
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5 
+     */  
+    function cancel():Boolean;
+    
 }
 }
\ No newline at end of file

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as Mon Aug  6 21:25:54 2012
@@ -1034,7 +1034,7 @@ public class GroupBase extends UICompone
     {
         if (_mouseEnabledWhereTransparent)
             $invalidateDisplayList();
-    _hasMouseListeners = value;
+        _hasMouseListeners = value;
     }
     
     /**

Added: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/HorizontalAccordionLayout.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/HorizontalAccordionLayout.as?rev=1370028&view=auto
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/HorizontalAccordionLayout.as (added)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/HorizontalAccordionLayout.as Mon Aug  6 21:25:54 2012
@@ -0,0 +1,318 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.components.supportClasses
+{
+import mx.core.mx_internal;
+
+import spark.components.Accordion;
+import spark.components.AccordionContent;
+import spark.components.supportClasses.Skin;
+import spark.events.ElementExistenceEvent;
+import spark.layouts.HorizontalLayout;
+import spark.layouts.VerticalAlign;
+
+use namespace mx_internal;
+
+/**
+ *  When creating a horizontal Accordion, use this layout in the Accordion's 
+ *  skin within the <code>contentGroup</code>.
+ * 
+ *  <p>Do not set <code>horizontalAlign</code> in this layout. 
+ *  Setting it will have no effect because the property is managed internally 
+ *  in this layout.</p>
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 11
+ *  @playerversion AIR 3.0
+ *  @productversion Flex 5.0
+ */
+public class HorizontalAccordionLayout extends HorizontalLayout
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  Constructor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public function HorizontalAccordionLayout()
+    {
+        super();
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------   
+    
+    //----------------------------------
+    //  accordion
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  The Accordion that owns this layout.
+     */
+    private function get accordion():Accordion
+    {
+        return target ? Accordion(Skin(target.parentDocument)["hostComponent"]) : null;
+    } 
+    
+    //----------------------------------
+    //  accordionHasSelection
+    //----------------------------------   
+    
+    /**
+     *  @private
+     */     
+    private function get accordionHasSelection():Boolean
+    {
+        return accordion && accordion.selectedElement;
+    }
+    
+    //----------------------------------
+    //  resizeToContent
+    //----------------------------------   
+    
+    /**
+     *  @private
+     */     
+    private function get resizeToContent():Boolean
+    {
+        return !accordion || accordion.resizeToContent;
+    }
+    
+    //----------------------------------
+    //  initialDimensions
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  If the Accordion does not define an explicitWidth or explicitHeight,
+     *  the initial dimensions are set to the Accordion's dimensions the first 
+     *  time an AccordionContent is selected.
+     *  The dimensions never change after being set.
+     */
+    private var _initialWidth:Number;
+    
+    /**
+     *  @private
+     */
+    private var _initialHeight:Number;
+    
+    /**
+     *  @private
+     */
+    private var _initialMinWidth:Number;
+    
+    /**
+     *  @private
+     */
+    private var _initialMinHeight:Number;
+    
+    /**
+     *  @private
+     */     
+    private function get initialDimensionsSet():Boolean
+    {
+        // If one of the initial dimensions is set, they should all be set.
+        return !isNaN(_initialWidth);
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------  
+    
+    /**
+     *  @private
+     */
+    override public function get verticalAlign():String
+    {
+        return resizeToContent ? VerticalAlign.CONTENT_JUSTIFY : VerticalAlign.JUSTIFY;
+    }
+    
+    /**
+     *  @private
+     */
+    override public function set target(value:GroupBase):void
+    {
+        if (target)
+        {
+            target.removeEventListener(ElementExistenceEvent.ELEMENT_ADD, accordion_elementAddHandler);
+            target.removeEventListener(ElementExistenceEvent.ELEMENT_REMOVE, accordion_elementRemoveHandler);
+        }
+        
+        super.target = value;
+        
+        if (target)
+        {
+            target.addEventListener(ElementExistenceEvent.ELEMENT_ADD, accordion_elementAddHandler);
+            target.addEventListener(ElementExistenceEvent.ELEMENT_REMOVE, accordion_elementRemoveHandler);
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  @private
+     *  This method is only called when explicit dimensions are not set.
+     *  There are two overall cases.
+     *  When the Accordion is resizing to content, then HorizontalLayout's
+     *  measure method is sufficient.
+     *  When the Accordion is not resizing to content, we may need to use
+     *  or set the cached initial dimensions.
+     */
+    override public function measure():void
+    {
+        if (!resizeToContent && initialDimensionsSet)
+        {
+            target.measuredWidth = _initialWidth;
+            target.measuredHeight = _initialHeight;
+            target.measuredMinWidth = _initialMinWidth;
+            target.measuredMinHeight = _initialMinHeight;
+        }
+        else if (!resizeToContent && accordionHasSelection)
+        {
+            super.measure();
+            _initialWidth = target.measuredWidth;
+            _initialHeight = target.measuredHeight;
+            _initialMinWidth = target.measuredMinWidth;
+            _initialMinHeight = target.measuredMinHeight;
+        }
+        else
+        {
+            super.measure();
+        }
+    }
+    
+    /**
+     *  @private
+     *  There are two overall cases.
+     *  When the Accordion is resizing to content, then HorizontalLayout's
+     *  updateDisplayList method is sufficient.
+     *  When the Accordion is not resizing to content, we may need to adjust
+     *  the width of the single selected AccordionContent to make sure it
+     *  doesn't hang out of the Accordion.
+     *  Remember, when the Accordion is not resizing to content, there can be
+     *  at most one selected AccordionContent.
+     */
+    override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+        
+        if (resizeToContent)
+            return;
+        
+        if (!accordion)
+            return;
+        
+        var selectedAccordionContent:AccordionContent = AccordionContent(accordion.selectedElement);
+        if (!selectedAccordionContent)
+            return;
+        
+        var selectedAccordionContentIsAnimating:Boolean = !isNaN(selectedAccordionContent.explicitWidth);
+        if (selectedAccordionContentIsAnimating)
+            return;
+        
+        // Determine the total measured width of the Accordion without the selected AccordionContent.
+        var numElements:int = accordion.numElements;
+        var totalWidthWithoutSelection:Number = paddingLeft + paddingRight + (numElements - 1) * gap;
+        for (var i:int = 0; i < numElements; i++)
+        {
+            if (i == accordion.selectedIndex)
+                continue;
+            
+            var accordionContent:AccordionContent = AccordionContent(accordion.getElementAt(i));
+            totalWidthWithoutSelection += accordionContent.measuredWidth;
+        }
+        
+        // Determine how wide the selected AccordionContent should actually be.
+        var selectionWidth:Number = Math.max(selectedAccordionContent.minWidth,
+            unscaledWidth - totalWidthWithoutSelection);
+        
+        // Resize the selected AccordionContent to its new width.
+        selectedAccordionContent.setLayoutBoundsSize(selectionWidth,
+            selectedAccordionContent.getLayoutBoundsHeight());
+        
+        // Reposition the AccordionContents after the selected AccordionContent.
+        var xPosition:Number = selectedAccordionContent.getLayoutBoundsX() + selectionWidth + gap;
+        for (i = accordion.selectedIndex + 1; i < numElements; i++)
+        {
+            accordionContent = AccordionContent(accordion.getElementAt(i));
+            accordionContent.setLayoutBoundsPosition(xPosition,
+                accordionContent.getLayoutBoundsY());
+            
+            xPosition += accordionContent.getLayoutBoundsWidth() + gap;
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+        
+    /**
+     *  @private
+     */
+    private function clearInitialDimensions():void
+    {
+        _initialWidth = NaN;
+        _initialHeight = NaN;
+        _initialMinWidth = NaN;
+        _initialMinHeight = NaN;
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+        
+    /**
+     *  @private
+     */
+    private function accordion_elementAddHandler(event:ElementExistenceEvent):void
+    {
+        clearInitialDimensions();
+    }   
+        
+    /**
+     *  @private
+     */
+    private function accordion_elementRemoveHandler(event:ElementExistenceEvent):void
+    {
+        clearInitialDimensions();           
+    }
+} 
+}
\ No newline at end of file

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/HorizontalAccordionLayout.as
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/HorizontalAccordionLayout.as
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as Mon Aug  6 21:25:54 2012
@@ -349,6 +349,7 @@ public class ItemRenderer extends DataRe
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
+    [Bindable]     
     public var labelDisplay:TextBase;
     
     //----------------------------------

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as Mon Aug  6 21:25:54 2012
@@ -934,7 +934,7 @@ public class ListBase extends SkinnableD
             else
                 _proposedSelectedIndex = NO_SELECTION;
             
-            if (allowCustomSelectedItem && _proposedSelectedIndex == -1)
+            if (allowCustomSelectedItem && _proposedSelectedIndex == -1 && _pendingSelectedItem != null)
             {
                 _proposedSelectedIndex = CUSTOM_SELECTED_ITEM;
                 _selectedItem = _pendingSelectedItem;

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/Range.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/Range.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/Range.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/Range.as Mon Aug  6 21:25:54 2012
@@ -451,8 +451,7 @@ public class Range extends SkinnableComp
         
         var maxValue:Number = maximum - minimum;
         var scale:Number = 1;
-        
-        value -= minimum;
+        var offset:Number = minimum; // the offset from 0.
         
         // If interval isn't an integer, there's a possibility that the floating point 
         // approximation of value or value/interval will be slightly larger or smaller 
@@ -463,20 +462,26 @@ public class Range extends SkinnableComp
         // we scale by the implicit precision of the interval and then round.  For 
         // example if interval=0.01, then we scale by 100.    
         
-        if (interval != Math.round(interval)) 
-        { 
+        if (interval != Math.round(interval))
+        {
+            // calculate scale and compute new scaled values.
             const parts:Array = (new String(1 + interval)).split("."); 
             scale = Math.pow(10, parts[1].length);
             maxValue *= scale;
-            value = Math.round(value * scale);
+            offset *= scale;
             interval = Math.round(interval * scale);
-        }   
-        
+            value = Math.round((value * scale) - offset);
+        }
+        else
+        {
+            value -= offset;
+        }
+
         var lower:Number = Math.max(0, Math.floor(value / interval) * interval);
         var upper:Number = Math.min(maxValue, Math.floor((value + interval) / interval) * interval);
         var validValue:Number = ((value - lower) >= ((upper - lower) / 2)) ? upper : lower;
         
-        return (validValue / scale) + minimum;
+        return (validValue + offset) / scale;
     }
     
     /**

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as Mon Aug  6 21:25:54 2012
@@ -282,16 +282,23 @@ public class RichEditableTextContainerMa
         var inactiveSelectionColor:* = textDisplay.getStyle(
                                             "inactiveTextSelectionColor"); 
 
+        var inactivePointAlpha:Number =
+            editingMode == EditingMode.READ_WRITE ?
+            1.0 :
+            0.0;
+        
         var inactiveAlpha:Number =
             textDisplay.selectionHighlighting == 
             TextSelectionHighlighting.ALWAYS ?
             1.0 :
             0.0;
 
-        // No insertion point when not active.
+        // Inactive is not unfocused so show an insertion point if there is one.
+        // This is consistent with TextField.
+        
         return new SelectionFormat(
             inactiveSelectionColor, inactiveAlpha, BlendMode.NORMAL,
-            inactiveSelectionColor, 0.0);
+            inactiveSelectionColor, inactivePointAlpha, BlendMode.INVERT);
     }   
     
     /**
@@ -327,6 +334,25 @@ public class RichEditableTextContainerMa
     {
         super.setText(text);
         
+        // Workaround a bug in setText().  Even if the selection is being preserved, the
+        // selection can still change.  In this case, dispatch a SELECTION_CHANGE event.
+        if (preserveSelectionOnSetText)
+        {
+            var im:ISelectionManager = beginInteraction();
+
+            if (im)
+            {
+                if (im.anchorPosition != textDisplay.selectionAnchorPosition ||
+                    im.activePosition != textDisplay.selectionActivePosition)
+                {
+                    // Dispatch the SELECTION_CHANGE event.
+                    SelectionManager(im).selectionChanged();
+                }
+            }
+                        
+            endInteraction();
+        }
+        
         // If we have focus, need to make sure we can still input text.
         initForInputIfHaveFocus();
     }
@@ -364,7 +390,7 @@ public class RichEditableTextContainerMa
             
             controller.requiredFocusInHandler(null);
             
-            if (!textDisplay.preserveSelectionOnSetText)
+            if (!preserveSelectionOnSetText)
                 im.selectRange(0, 0);
             
             endInteraction();

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as Mon Aug  6 21:25:54 2012
@@ -445,8 +445,13 @@ public class SkinnableComponent extends 
         if (!skipReload)
         {
             if (skin)
-                detachSkin();
-            attachSkin();
+            {
+                detachSkin();                
+                // If there is an error skin remove it since it has to go on top of the new skin.
+                removeErrorSkin();
+            }
+            attachSkin();            
+            updateErrorSkin();
         }
     }
     
@@ -831,12 +836,20 @@ public class SkinnableComponent extends 
         }
         else
         {
-            if (errorObj)
-                super.removeChild(errorObj);
-            
+            removeErrorSkin();
+        }
+    }
+    
+    private function removeErrorSkin():void
+    {
+        if (errorObj)
+        {
+            super.removeChild(errorObj);
             errorObj = null;
         }
+
     }
+
     //--------------------------------------------------------------------------
     //
     //  Methods - Parts

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as Mon Aug  6 21:25:54 2012
@@ -905,7 +905,7 @@ public class SkinnableTextBase extends S
     [Inspectable(category="General", defaultValue="false")]
 
     /**
-     *  @copy flash.text.TextField#displayAsPassword
+     *  @inheritDoc
      * 
      *  @default false
      * 
@@ -1090,7 +1090,7 @@ public class SkinnableTextBase extends S
     [Inspectable(category="General", defaultValue="0")]    
 
     /**
-     *  @copy flash.text.TextField#maxChars
+     *  @inheritDoc
      * 
      *  @default 0
      * 
@@ -1136,7 +1136,7 @@ public class SkinnableTextBase extends S
     [Inspectable(category="General", defaultValue="null")]
 
     /**
-     *  @copy flash.text.TextField#restrict
+     *  @inheritDoc
      * 
      *  @default null
      *  
@@ -1899,7 +1899,7 @@ public class SkinnableTextBase extends S
     //--------------------------------------------------------------------------
     
     /**
-     *  @copy spark.core.IEditableText#insertText()
+     *  @inheritDoc
      *   
      *  @see spark.components.RichEditableText#insertText()
      *  @see spark.components.supportClasses.StyleableStageText#insertText()
@@ -1921,7 +1921,7 @@ public class SkinnableTextBase extends S
     }
 
     /**
-     *  @copy spark.core.IEditableText#appendText()
+     *  @inheritDoc
      *  
      *  @see spark.components.RichEditableText#appendText()
      *  @see spark.components.supportClasses.StyleableStageText#appendText()
@@ -1943,7 +1943,7 @@ public class SkinnableTextBase extends S
     }
     
     /**
-     *  @copy spark.core.IEditableText#selectRange()
+     *  @inheritDoc
      *  
      *  @see spark.components.RichEditableText#selectRange()
      *  @see spark.components.supportClasses.StyleableStageText#selectRange()
@@ -1965,7 +1965,7 @@ public class SkinnableTextBase extends S
     }
 
     /**
-     *  @copy spark.core.IEditableText#selectAll()
+     *  @inheritDoc
      * 
      *  @see spark.components.RichEditableText#selectAll()
      *  @see spark.components.supportClasses.StyleableStageText#selectAll()

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as Mon Aug  6 21:25:54 2012
@@ -34,7 +34,6 @@ import mx.core.IFactory;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
-import mx.formatters.NumberFormatter;
 import mx.managers.IFocusManagerComponent;
 
 import spark.effects.animation.Animation;
@@ -42,6 +41,7 @@ import spark.effects.animation.MotionPat
 import spark.effects.animation.SimpleMotionPath;
 import spark.effects.easing.Sine;
 import spark.events.TrackBaseEvent;
+import spark.formatters.NumberFormatter;
 
 use namespace mx_internal;
 
@@ -572,9 +572,13 @@ public class SliderBase extends TrackBas
         else
         {
             if (dataFormatter == null)
+            {
                 dataFormatter = new NumberFormatter();
+                addStyleClient(dataFormatter);
+            }
                 
-            dataFormatter.precision = dataTipPrecision;
+            dataFormatter.fractionalDigits = dataTipPrecision;
+            dataFormatter.trailingZeros = true;
             
             formattedValue = dataFormatter.format(value);   
         }
@@ -697,7 +701,11 @@ public class SliderBase extends TrackBas
         }
         
         if (dataTipInstance && showDataTip)
-        { 
+        {
+            // If showing the dataTip, we need to validate to
+            // make sure the thumb is in the right position.
+            //validateNow();
+            
             dataTipInstance.data = formatDataTipText(pendingValue);
             
             // Force the dataTip to render so that we have the correct size since

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as Mon Aug  6 21:25:54 2012
@@ -650,7 +650,7 @@ public class TouchScrollHelper
             dragTimer = null;
         }
         
-
+        
         // Note that we do not add the time and position of the mouseUp event to 
         // our event history.  This is because the timing of this event is unreliable
         // and causes problems for our velocity calculation.

Added: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/VerticalAccordionLayout.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/VerticalAccordionLayout.as?rev=1370028&view=auto
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/VerticalAccordionLayout.as (added)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/VerticalAccordionLayout.as Mon Aug  6 21:25:54 2012
@@ -0,0 +1,317 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.components.supportClasses
+{
+import mx.core.mx_internal;
+
+import spark.components.Accordion;
+import spark.components.AccordionContent;
+import spark.events.ElementExistenceEvent;
+import spark.layouts.HorizontalAlign;
+import spark.layouts.VerticalLayout;
+
+use namespace mx_internal;
+
+/**
+ *  When creating a vertical Accordion, use this layout in the Accordion's 
+ *  skin within the <code>contentGroup</code>.
+ * 
+ *  <p>Do not set <code>horizontalAlign</code> in this layout. 
+ *  Setting it will have no effect because the property is managed internally 
+ *  in this layout.</p>
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 11
+ *  @playerversion AIR 3.0
+ *  @productversion Flex 5.0
+ */
+public class VerticalAccordionLayout extends VerticalLayout
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  Constructor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public function VerticalAccordionLayout()
+    {
+        super();
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------   
+    
+    //----------------------------------
+    //  accordion
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  The Accordion that owns this layout.
+     */
+    private function get accordion():Accordion
+    {
+        return target ? Accordion(Skin(target.parentDocument)["hostComponent"]) : null;
+    } 
+    
+    //----------------------------------
+    //  accordionHasSelection
+    //----------------------------------   
+    
+    /**
+     *  @private
+     */     
+    private function get accordionHasSelection():Boolean
+    {
+        return accordion && accordion.selectedElement;
+    }
+    
+    //----------------------------------
+    //  resizeToContent
+    //----------------------------------   
+    
+    /**
+     *  @private
+     */     
+    private function get resizeToContent():Boolean
+    {
+        return !accordion || accordion.resizeToContent;
+    }
+    
+    //----------------------------------
+    //  initialDimensions
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  If the Accordion does not define an explicitWidth or explicitHeight,
+     *  the initial dimensions are set to the Accordion's dimensions the first 
+     *  time an AccordionContent is selected.
+     *  The dimensions never change after being set.
+     */
+    private var _initialWidth:Number;
+    
+    /**
+     *  @private
+     */
+    private var _initialHeight:Number;
+    
+    /**
+     *  @private
+     */
+    private var _initialMinWidth:Number;
+    
+    /**
+     *  @private
+     */
+    private var _initialMinHeight:Number;
+    
+    /**
+     *  @private
+     */     
+    private function get initialDimensionsSet():Boolean
+    {
+        // If one of the initial dimensions is set, they should all be set.
+        return !isNaN(_initialWidth);
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------  
+    
+    /**
+     *  @private
+     */
+    override public function get horizontalAlign():String
+    {
+        return resizeToContent ? HorizontalAlign.CONTENT_JUSTIFY : HorizontalAlign.JUSTIFY;
+    }
+    
+    /**
+     *  @private
+     */
+    override public function set target(value:GroupBase):void
+    {
+        if (target)
+        {
+            target.removeEventListener(ElementExistenceEvent.ELEMENT_ADD, accordion_elementAddHandler);
+            target.removeEventListener(ElementExistenceEvent.ELEMENT_REMOVE, accordion_elementRemoveHandler);
+        }
+        
+        super.target = value;
+        
+        if (target)
+        {
+            target.addEventListener(ElementExistenceEvent.ELEMENT_ADD, accordion_elementAddHandler);
+            target.addEventListener(ElementExistenceEvent.ELEMENT_REMOVE, accordion_elementRemoveHandler);
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  @private
+     *  This method is only called when explicit dimensions are not set.
+     *  There are two overall cases.
+     *  When the Accordion is resizing to content, then VerticalLayout's
+     *  measure method is sufficient.
+     *  When the Accordion is not resizing to content, we may need to use
+     *  or set the cached initial dimensions.
+     */
+    override public function measure():void
+    {
+        if (!resizeToContent && initialDimensionsSet)
+        {
+            target.measuredWidth = _initialWidth;
+            target.measuredHeight = _initialHeight;
+            target.measuredMinWidth = _initialMinWidth;
+            target.measuredMinHeight = _initialMinHeight;
+        }
+        else if (!resizeToContent && accordionHasSelection)
+        {
+            super.measure();
+            _initialWidth = target.measuredWidth;
+            _initialHeight = target.measuredHeight;
+            _initialMinWidth = target.measuredMinWidth;
+            _initialMinHeight = target.measuredMinHeight;
+        }
+        else
+        {
+            super.measure();
+        }
+    }
+    
+    /**
+     *  @private
+     *  There are two overall cases.
+     *  When the Accordion is resizing to content, then VerticalLayout's
+     *  updateDisplayList method is sufficient.
+     *  When the Accordion is not resizing to content, we may need to adjust
+     *  the height of the single selected AccordionContent to make sure it
+     *  doesn't hang out of the Accordion.
+     *  Remember, when the Accordion is not resizing to content, there can be
+     *  at most one selected AccordionContent.
+     */
+    override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+        
+        if (resizeToContent)
+            return;
+        
+        if (!accordion)
+            return;
+        
+        var selectedAccordionContent:AccordionContent = AccordionContent(accordion.selectedElement);
+        if (!selectedAccordionContent)
+            return;
+        
+        var selectedAccordionContentIsAnimating:Boolean = !isNaN(selectedAccordionContent.explicitHeight);
+        if (selectedAccordionContentIsAnimating)
+            return;
+        
+        // Determine the total measured height of the Accordion without the selected AccordionContent.
+        var numElements:int = accordion.numElements;
+        var totalHeightWithoutSelection:Number = paddingTop + paddingBottom + (numElements - 1) * gap;
+        for (var i:int = 0; i < numElements; i++)
+        {
+            if (i == accordion.selectedIndex)
+                continue;
+            
+            var accordionContent:AccordionContent = AccordionContent(accordion.getElementAt(i));
+            totalHeightWithoutSelection += accordionContent.measuredHeight;
+        }
+        
+        // Determine how tall the selected AccordionContent should actually be.
+        var selectionHeight:Number = Math.max(selectedAccordionContent.minHeight,
+            unscaledHeight - totalHeightWithoutSelection);
+        
+        // Resize the selected AccordionContent to its new height.
+        selectedAccordionContent.setLayoutBoundsSize(selectedAccordionContent.getLayoutBoundsWidth(),
+            selectionHeight);
+        
+        // Reposition the AccordionContents after the selected AccordionContent.
+        var yPosition:Number = selectedAccordionContent.getLayoutBoundsY() + selectionHeight + gap;
+        for (i = accordion.selectedIndex + 1; i < numElements; i++)
+        {
+            accordionContent = AccordionContent(accordion.getElementAt(i));
+            accordionContent.setLayoutBoundsPosition(accordionContent.getLayoutBoundsX(),
+                yPosition);
+            
+            yPosition += accordionContent.getLayoutBoundsHeight() + gap;
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function clearInitialDimensions():void
+    {
+        _initialWidth = NaN;
+        _initialHeight = NaN;
+        _initialMinWidth = NaN;
+        _initialMinHeight = NaN;
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */    
+    private function accordion_elementAddHandler(event:ElementExistenceEvent):void
+    {
+        clearInitialDimensions();
+    }   
+
+    /**
+     *  @private
+     */
+    private function accordion_elementRemoveHandler(event:ElementExistenceEvent):void
+    {
+        clearInitialDimensions();           
+    }
+} 
+}
\ No newline at end of file

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/VerticalAccordionLayout.as
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/VerticalAccordionLayout.as
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ViewStackLayout.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ViewStackLayout.as?rev=1370028&view=auto
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ViewStackLayout.as (added)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ViewStackLayout.as Mon Aug  6 21:25:54 2012
@@ -0,0 +1,615 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.components.supportClasses
+{
+import flash.geom.Rectangle;
+
+import mx.core.IDeferredContentOwner;
+import mx.core.ILayoutElement;
+import mx.core.IVisualElement;
+import mx.core.IUIComponent;
+import mx.core.mx_internal;
+import mx.resources.ResourceManager;
+
+import spark.layouts.supportClasses.DropLocation;
+import spark.layouts.supportClasses.LayoutBase;
+import spark.layouts.supportClasses.LayoutElementHelper;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+[ResourceBundle("layout")]
+
+/**
+ *  The ViewStackLayout class arranges its elements to overlay each other. Each 
+ *  element is positioned at the upper-left point of the target container.
+ *  The size of the target container depends on the value of resizeToContent
+ *  flag. If resizeToContent is false then the target container's size is the
+ *  size of the first active child and does not change when the selected 
+ *  child is changed.  If resizeToContent is true, then the target container 
+ *  will be re-sized to the size of the selected child. 
+ * 
+ *  This layout is designed be used with the Spark ViewStack container
+ *  where only the selected child is visible. But it is possible to use it with
+ *  other containers as well.
+ * 
+ *  <p>The default size of the target container is the width and height of the 
+ *  initial active child.</p>
+ * 
+ *  <p>By default, elements are sized only once to fit the size of the 
+ *  first selected child element. They do not re-size when the selected child 
+ *  is changed. To force the target container to re-size when you change the  
+ *  selected child, set the resizeToContent property to true.</p>
+ *  
+ *  <p>Elements are sized to their default size. If the child is larger than 
+ *  the target container, it is clipped. If the child is smaller than the 
+ *  target container, it is aligned to the upper-left corner of the target
+ *  container and re-sized to fill the target container.</p>
+ * 
+ *  @mxml 
+ *  <p>The <code>&lt;s:ViewStackLayout&gt;</code> tag inherits all of the tag 
+ *  attributes of its superclass and adds the following tag attributes:</p>
+ *
+ *  <pre>
+ *  &lt;s:ViewStackLayout
+ *    <b>Properties</b>
+ *    paddingBottom="0"
+ *    paddingLeft="0"
+ *    paddingRight="0"
+ *    paddingTop="0"
+ *    resizeToContent="false|true"
+ *    selectedIndex="0"
+ *  &lt;/s:ViewStackLayout&gt;
+ *  </pre>
+ * 
+ *  @see spark.components.ViewStack
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 11
+ *  @playerversion AIR 3.0
+ *  @productversion Flex 5.0
+ */
+public class ViewStackLayout extends LayoutBase
+{
+    include "../../core/Version.as";
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+    
+    private static function constraintsDetermineWidth(layoutElement:ILayoutElement):Boolean
+    {
+        return !isNaN(layoutElement.percentWidth) ||
+            !isNaN(LayoutElementHelper.parseConstraintValue(layoutElement.left)) &&
+            !isNaN(LayoutElementHelper.parseConstraintValue(layoutElement.right));
+    }
+    
+    private static function constraintsDetermineHeight(layoutElement:ILayoutElement):Boolean
+    {
+        return !isNaN(layoutElement.percentHeight) ||
+            !isNaN(LayoutElementHelper.parseConstraintValue(layoutElement.top)) &&
+            !isNaN(LayoutElementHelper.parseConstraintValue(layoutElement.bottom));
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  Constructor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public function ViewStackLayout():void
+    {
+        super();
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  @private
+     *  We'll measure ourselves once and then store the results here.
+     */
+    private var cachedMeasuredMinWidth:Number;
+    private var cachedMeasuredMinHeight:Number;
+    private var cachedMeasuredWidth:Number;
+    private var cachedMeasuredHeight:Number;
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+    
+    //----------------------------------
+    //  paddingBottom
+    //----------------------------------
+    
+    private var _paddingBottom:Number = 0;
+    
+    [Inspectable(category="General")]
+    
+    /**
+     *  Number of pixels between the container's bottom edge
+     *  and the bottom edge of the last layout element.
+     * 
+     *  @default 0
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public function get paddingBottom():Number
+    {
+        return _paddingBottom;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set paddingBottom(value:Number):void
+    {
+        if (_paddingBottom == value)
+            return;
+        
+        _paddingBottom = value;
+        invalidateTargetSizeAndDisplayList();
+    }    
+    
+    //----------------------------------
+    //  paddingLeft
+    //----------------------------------
+    
+    private var _paddingLeft:Number = 0;
+    
+    [Inspectable(category="General")]
+    
+    /**
+     *  The minimum number of pixels between the container's left edge and
+     *  the left edge of the layout element.
+     * 
+     *  @default 0
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public function get paddingLeft():Number
+    {
+        return _paddingLeft;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set paddingLeft(value:Number):void
+    {
+        if (_paddingLeft == value)
+            return;
+        
+        _paddingLeft = value;
+        invalidateTargetSizeAndDisplayList();
+    }    
+    
+    //----------------------------------
+    //  paddingRight
+    //----------------------------------
+    
+    private var _paddingRight:Number = 0;
+    
+    [Inspectable(category="General")]
+    
+    /**
+     *  The minimum number of pixels between the container's right edge and
+     *  the right edge of the layout element.
+     * 
+     *  @default 0
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public function get paddingRight():Number
+    {
+        return _paddingRight;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set paddingRight(value:Number):void
+    {
+        if (_paddingRight == value)
+            return;
+        
+        _paddingRight = value;
+        invalidateTargetSizeAndDisplayList();
+    }    
+    
+    //----------------------------------
+    //  paddingTop
+    //----------------------------------
+    
+    private var _paddingTop:Number = 0;
+    
+    [Inspectable(category="General")]
+    
+    /**
+     *  Number of pixels between the container's top edge
+     *  and the top edge of the first layout element.
+     * 
+     *  @default 0
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public function get paddingTop():Number
+    {
+        return _paddingTop;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set paddingTop(value:Number):void
+    {
+        if (_paddingTop == value)
+            return;
+        
+        _paddingTop = value;
+        invalidateTargetSizeAndDisplayList();
+    }    
+    
+    //----------------------------------
+    //  resizeToContent
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  Storage for the resizeToContent property.
+     */
+    private var _resizeToContent:Boolean = false;
+    
+    /**
+     *  @copy spark.components.ViewStack#resizeToContent 
+     */
+    public function get resizeToContent():Boolean
+    {
+        return _resizeToContent;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set resizeToContent(value:Boolean):void
+    {
+        if (value != _resizeToContent)
+        {
+            _resizeToContent = value;
+            
+            if (value && target)
+            {
+                target.invalidateSize();
+                target.invalidateDisplayList();
+            }
+        }
+    }
+    
+    //----------------------------------
+    //  selectedIndex
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  Storage for the selectedIndex property.
+     */
+    private var _selectedIndex:int = -1;
+    
+    [Bindable("change")]
+    [Bindable("valueCommit")]
+    [Bindable("creationComplete")]
+    [Inspectable(category="General")]
+    
+    /**
+     *  @copy spark.components.ViewStack#selectedIndex 
+     */
+    public function get selectedIndex():int
+    {
+        return _selectedIndex;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set selectedIndex(value:int):void
+    {
+        // The selectedIndex must be -1 if there are no children,
+        // even if a selectedIndex has been proposed.
+        if (target.numElements == 0)
+        {
+            _selectedIndex = -1;
+            return;
+        }
+        
+        // If there are children, ensure that the new index is in bounds.
+        if (value < 0)
+            value = 0;
+        else if (value > target.numElements - 1)
+            value = target.numElements - 1;
+        
+        // Bail if the index isn't changing.
+        if (value == selectedIndex)
+            return;
+                
+        _selectedIndex = value;
+        
+        if (target)
+        {
+            if (resizeToContent)
+                target.invalidateSize();
+            
+            target.invalidateDisplayList();
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private 
+     */
+    override public function measure():void
+    {
+        // Virtual layouts are not supported. This class is not public so we 
+        // are not throwing an error if someone tries to use virtual layouts.
+        super.measure();
+        
+        var layoutTarget:GroupBase = target;
+        if (!layoutTarget)
+            return;
+        
+        // If resizeToContent is false then only size the target once.
+        if (!resizeToContent && cachedMeasuredWidth)
+        {
+            layoutTarget.measuredWidth = cachedMeasuredWidth;
+            layoutTarget.measuredHeight = cachedMeasuredHeight;
+            layoutTarget.measuredMinWidth = cachedMeasuredMinWidth;
+            layoutTarget.measuredMinHeight = cachedMeasuredMinHeight;
+            return;				
+        }
+        
+        // A ViewStackLayout measures itself based only on its selectedChild.
+        // The minimum, maximum, and preferred sizes are those of the
+        // selected child.
+        var minWidth:Number = 0;
+        var minHeight:Number = 0;
+        var preferredWidth:Number = 0;
+        var preferredHeight:Number = 0;
+        
+        if (layoutTarget.numElements > 0 && selectedIndex != -1)
+        {
+            var child:IVisualElement =
+                layoutTarget.getElementAt(selectedIndex);
+            
+            minWidth = child.getMinBoundsWidth();
+            preferredWidth = child.getPreferredBoundsWidth();
+            
+            minHeight = child.getMinBoundsHeight();
+            preferredHeight = child.getPreferredBoundsHeight();
+        }
+        
+        var hPadding:Number = paddingLeft + paddingRight;
+        var vPadding:Number = paddingTop + paddingBottom;
+        
+        layoutTarget.measuredMinWidth = minWidth + hPadding;
+        layoutTarget.measuredMinHeight = minHeight + vPadding;
+        layoutTarget.measuredWidth = preferredWidth + hPadding;
+        layoutTarget.measuredHeight = preferredHeight + vPadding;
+        
+        // If we're called before instantiateSelectedChild, then bail.
+        // We'll be called again later (instantiateSelectedChild calls
+        // invalidateSize), and we don't want to load values into the
+        // cache until we're fully initialized.  (bug 102639)
+        // This check was moved from the beginning of this function to
+        // here to fix bug 103665.
+        var selectedChild:IVisualElement = getSelectedChild();
+        if ((selectedChild is IDeferredContentOwner) && 
+            IDeferredContentOwner(selectedChild).deferredContentCreated == false)
+            return;
+        
+        // Don't remember sizes if we don't have any children
+        if (layoutTarget.numElements == 0)
+            return;
+        
+        cachedMeasuredMinWidth = minWidth;
+        cachedMeasuredMinHeight = minHeight;
+        cachedMeasuredWidth = preferredWidth;
+        cachedMeasuredHeight = preferredHeight;
+    }
+    
+    /**
+     *  @private 
+     */
+    override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+        
+        var w:Number = unscaledWidth - paddingLeft - paddingRight;
+        var h:Number = unscaledHeight - paddingTop - paddingBottom;
+        
+        var left:Number = paddingLeft;
+        var top:Number = paddingTop;
+        
+        // Stretch the selectedIndex to fill our size
+        if (selectedIndex != -1)
+        {
+            var child:IVisualElement = target.getElementAt(selectedIndex);
+            
+            var newWidth:Number = w;
+            var newHeight:Number = h;
+            
+            if (!isNaN(child.percentWidth))
+            {
+                var maxWidth:Number = child.getMaxBoundsWidth();
+                if (newWidth > maxWidth)
+                    newWidth = maxWidth;
+            }
+            else
+            {
+                // If the child implements IUIComponent then check if an explicit
+                // width is set. If it is then we will respect the explict width of 
+                // the child instead of treating it like 100%.
+                // If the child is not IUIComponent then use the preferred size.
+                // The difference is, for non-IUIComponents they will need to 
+                // set their width to 100% to be sized to the width of the 
+                // ViewStack whereas IUIComponents will get that for free. The 
+                // special case for IUIComponents is put in to mimic the 
+                // behavior of the Halo ViewStack.
+                var explicitWidth:Number = (child is IUIComponent) ? 
+                                                IUIComponent(child).explicitWidth :
+                                                child.getPreferredBoundsWidth();
+                if (newWidth > explicitWidth)
+                    newWidth = explicitWidth;
+            }
+            
+            if (!isNaN(child.percentHeight))
+            {
+                var maxHeight:Number = child.getMaxBoundsHeight();
+                if (newHeight > maxHeight)
+                    newHeight = maxHeight;
+            }
+            else
+            {
+                // Comment above for explicit width applies here for height.
+                var explicitHeight:Number = (child is IUIComponent) ?
+                                                IUIComponent(child).explicitHeight :
+                                                child.getPreferredBoundsHeight();
+                if (newHeight > explicitHeight)
+                    newHeight = explicitHeight;
+            }
+            
+            if (child.width != newWidth || child.height != newHeight)
+                child.setLayoutBoundsSize(newWidth, newHeight);
+            if (child.x != left || child.y != top)
+                child.setLayoutBoundsPosition(left, top);
+            
+        }
+        
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  @private 
+     *  Convenience function for subclasses that invalidates the
+     *  target's size and displayList so that both layout's <code>measure()</code>
+     *  and <code>updateDisplayList</code> methods get called.
+     * 
+     *  <p>Typically a layout invalidates the target's size and display list so that
+     *  it gets a chance to recalculate the target's default size and also size and
+     *  position the target's elements. For example changing the <code>gap</code>
+     *  property on a <code>VerticalLayout</code> will internally call this method
+     *  to ensure that the elements are re-arranged with the new setting and the
+     *  target's default size is recomputed.</p> 
+     */
+    private function invalidateTargetSizeAndDisplayList():void
+    {
+        var g:GroupBase = target;
+        if (!g)
+            return;
+        
+        g.invalidateSize();
+        g.invalidateDisplayList();
+    }
+    
+    /**
+     *  @private
+     */
+    override protected function calculateDropIndicatorBounds(dropLocation:DropLocation):Rectangle
+    {
+        var dropIndex:int = dropLocation.dropIndex;
+        var count:int = 1;
+        
+        var emptySpaceTop:Number = 0;
+        if (target.numElements > 0)
+        {
+            emptySpaceTop = (dropIndex < count) ? getElementBounds(dropIndex).top : 
+                getElementBounds(dropIndex - 1).bottom;
+        }
+        
+        // Calculate the size of the bounds, take minium and maximum into account
+        var width:Number = Math.max(target.width, target.contentWidth) - paddingLeft - paddingRight;
+        var height:Number = 0;
+        if (dropIndicator is IVisualElement)
+        {
+            var element:IVisualElement = IVisualElement(dropIndicator);
+            height = Math.max(Math.min(height, element.getMaxBoundsHeight(false)), element.getMinBoundsHeight(false));
+        }
+        
+        var x:Number = paddingLeft;
+        
+        var y:Number = emptySpaceTop + Math.round((-height)/2);
+        // Allow 1 pixel overlap with container border
+        y = Math.max(-1, Math.min(target.contentHeight - height + 1, y));
+        return new Rectangle(x, y, width, height);
+    }
+    
+    /**
+     *  A reference to the currently visible child container.
+     *  The default is a reference to the first child.
+     *  If there are no children, this property is <code>null</code>.
+     */
+    private function getSelectedChild():IVisualElement
+    {
+        if (selectedIndex == -1 || !target)
+            return null;
+        
+        return IVisualElement(target.getElementAt(selectedIndex));
+    }
+    
+    
+}
+
+}

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ViewStackLayout.as
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/components/supportClasses/ViewStackLayout.as
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/core/ContainerDestructionPolicy.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/core/ContainerDestructionPolicy.as?rev=1370028&view=auto
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/core/ContainerDestructionPolicy.as (added)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/core/ContainerDestructionPolicy.as Mon Aug  6 21:25:54 2012
@@ -0,0 +1,74 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.core
+{
+/**
+ *  The ContainerCreationPolicy class defines the constant values
+ *  for the <code>destructionPolicy</code> property of spark view
+ *  classes.
+ *
+ *  @see spark.components.supportClasses.ViewNavigatorBase#destructionPolicy
+ *  @see spark.components.View#destructionPolicy
+ *  
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public final class ContainerDestructionPolicy
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+    
+	/**
+	 *  The container always destroys its children.
+	 * 
+	 *  @langversion 3.0
+	 *  @playerversion Flash 11
+	 *  @playerversion AIR 3.0
+	 *  @productversion Flex 5.0
+	 */
+	public static const ALWAYS:String = "always";
+
+	/**
+     *  The lifespan of the container's children is automatically
+     *  managed by the container based on the container's own
+     *  heuristic.
+     * 
+     *  @langversion 3.0
+	 *  @playerversion Flash 11
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public static const AUTO:String = "auto";
+    
+    /**
+     *  The container never destroys its children.
+     * 
+     *  @langversion 3.0
+	 *  @playerversion Flash 11
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public static const NEVER:String = "never";
+}
+}
\ No newline at end of file

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/core/ContainerDestructionPolicy.as
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/core/ContainerDestructionPolicy.as
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/effects/supportClasses/ResizeInstance.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/effects/supportClasses/ResizeInstance.as?rev=1370028&r1=1370027&r2=1370028&view=diff
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/effects/supportClasses/ResizeInstance.as (original)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/effects/supportClasses/ResizeInstance.as Mon Aug  6 21:25:54 2012
@@ -288,7 +288,6 @@ public class ResizeInstance extends Anim
                 setupConstraintAnimation("bottom");
             }
         }
-        
         super.play();        
     }
 
@@ -313,6 +312,8 @@ public class ResizeInstance extends Anim
         {
             if (!isNaN(widthTo) && !isNaN(widthBy))
                 widthFrom = widthTo - widthBy;
+            else if (propertyChanges && propertyChanges.start["width"] !== undefined)
+                widthFrom = propertyChanges.start["width"];
         }
         if (isNaN(widthTo))
         {       
@@ -344,6 +345,8 @@ public class ResizeInstance extends Anim
         {
             if (!isNaN(heightTo) && !isNaN(heightBy))
                 heightFrom = heightTo - heightBy;
+            else if (propertyChanges && propertyChanges.start["height"] !== undefined)
+                heightFrom = propertyChanges.start["height"];
         }
         if (isNaN(heightTo))
         {       

Added: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/events/DateChooserEvent.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/events/DateChooserEvent.as?rev=1370028&view=auto
==============================================================================
--- incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/events/DateChooserEvent.as (added)
+++ incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/events/DateChooserEvent.as Mon Aug  6 21:25:54 2012
@@ -0,0 +1,201 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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;
+    
+    /**
+     *  The DateChooser control dispatch these events when its displayed state changes due to 
+     *  user interaction.
+     *
+     *  @see spark.components.DateChooser
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 11
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 5.0
+     */
+    public class DateChooserEvent extends Event
+    {
+        include "../core/Version.as";
+        
+        //--------------------------------------------------------------------------
+        //
+        //  Class constants
+        //
+        //--------------------------------------------------------------------------
+        
+        /**
+         *  The <code>DateChooserEvent.CARET_CHANGE</code> constant defines 
+         *  the value of the <code>type</code> property of the event object for a 
+         *  <code>caretChange</code> event, which indicates that the current 
+         *  caret position has just been changed.
+         *
+         *
+         *  <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>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>detail</code></td><td>The scroll direction.</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>
+         *  </table>
+         *
+         *  @eventType caretChange
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 11
+         *  @playerversion AIR 3.0
+         *  @productversion Flex 5.0
+         */
+        public static const CARET_CHANGE:String = "caretChange";
+        
+        /**
+         *  The <code>DateChooserEvent.MONTH_SCROLL</code> constant defines the value of the 
+         *  <code>type</code> property of the event object for a <code>monthScroll</code>event,
+         *  which indicates that the month(s) dispayed has changed because of user interaction.
+         *
+         *  <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>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>detail</code></td><td>The scroll direction.</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>
+         *  </table>
+         *
+         *  @eventType scroll
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 11
+         *  @playerversion AIR 3.0
+         *  @productversion Flex 5.0
+         */
+        public static const MONTH_SCROLL:String = "monthScroll";
+        
+        /**
+         *  The <code>DateChooserEvent.SELECTION_CHANGE</code> constant defines 
+         *  the value of the <code>type</code> property of the event object for a 
+         *  <code>selectionChange</code> event, which indicates that the current 
+         *  selection has just been changed.
+         *
+         *  <p>This event is dispatched when the user interacts with the control.
+         *  When you change the selection programmatically, the component does not dispatch the 
+         *  <code>selectionChange</code> event. </p>
+         *
+         *  <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>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>detail</code></td><td>The scroll direction.</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>
+         *  </table>
+         *
+         *  @eventType selectionChange
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 11
+         *  @playerversion AIR 3.0
+         *  @productversion Flex 5.0
+         */
+        public static const SELECTION_CHANGE:String = "selectionChange";
+        
+        //--------------------------------------------------------------------------
+        //
+        //  Constructor
+        //
+        //--------------------------------------------------------------------------
+        
+        // TBD: could be more than one month or one year
+        
+        /**
+         *  Constructor.
+         *  Normally called by the DateChooser object and not used in application code.
+         *
+         *  @param type The event type; indicates the action that triggered 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.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 9
+         *  @playerversion AIR 1.1
+         *  @productversion Flex 3
+         */
+        public function DateChooserEvent(type:String, bubbles:Boolean = false,
+                                         cancelable:Boolean = false)
+        {
+            super(type, bubbles, cancelable);
+        }
+        
+        //--------------------------------------------------------------------------
+        //
+        //  Properties
+        //
+        //--------------------------------------------------------------------------
+               
+        //--------------------------------------------------------------------------
+        //
+        //  Overridden methods: Event
+        //
+        //--------------------------------------------------------------------------
+        
+        /**
+         *  @private
+         */
+        override public function clone():Event
+        {
+            return new DateChooserEvent(type, bubbles, cancelable);
+        }
+
+        /**
+         *  @private
+         */
+        override public function toString():String
+        {
+            return formatToString(
+                "DateChooserEvent", "type", 
+                "bubbles", "cancelable", "eventPhase");
+        }
+            
+    }
+    
+}

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/events/DateChooserEvent.as
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/flex/whiteboard/cframpton/adobe.next/frameworks/projects/spark/src/spark/events/DateChooserEvent.as
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message