/* Copyright (c) 2007 FlexLib Contributors. See: http://code.google.com/p/flexlib/wiki/ProjectContributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package flexlib.containers { import mx.containers.utilityClasses.Layout; import mx.core.Container; import mx.core.mx_internal; import flexlib.containers.utilityClasses.AdobeFlowLayout; use namespace mx_internal; //-------------------------------------- // Styles //-------------------------------------- /** * Number of pixels between children in the horizontal direction. */ [Style(name="horizontalGap", type="Number", format="Length", inherit="no")] /** * Number of pixels between children in the vertical direction. */ [Style(name="verticalGap", type="Number", format="Length", inherit="no")] //-------------------------------------- // Excluded APIs //-------------------------------------- [Exclude(name="focusIn", kind="event")] [Exclude(name="focusOut", kind="event")] [Exclude(name="focusBlendMode", kind="style")] [Exclude(name="focusSkin", kind="style")] [Exclude(name="focusThickness", kind="style")] [Exclude(name="focusInEffect", kind="effect")] [Exclude(name="focusOutEffect", kind="effect")] /** * The FlowContainer is a flow layout based container. * */ public class FlowContainer extends Container { //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Constructor. */ public function FlowContainer() { super(); horizontalScrollPolicy = "off"; layoutObject.target = this; } //-------------------------------------------------------------------------- // // Variables // //-------------------------------------------------------------------------- /** * @private */ mx_internal var layoutObject:AdobeFlowLayout = new AdobeFlowLayout(); //-------------------------------------------------------------------------- // // Overridden properties // //-------------------------------------------------------------------------- /** * @private */ override public function set height(newHeight:Number):void { layoutObject.explicitHeightSet = true; super.height = newHeight; } /** * @private */ override protected function measure():void { super.measure(); layoutObject.measure(); } /** * @private */ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); layoutObject.updateDisplayList(unscaledWidth, unscaledHeight); } } }