blob: 52b313dbd89f8a513ea864ba7464a2eb319b6d19 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<s:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
xmlns:my="*">
<s:Panel width="100%" height="100%" title="Custom Layout - Flow Layout" >
<s:layout>
<s:VerticalLayout horizontalAlign="center"
paddingTop="10" gap="10"/>
</s:layout>
<!-- The drop-down to select vertical alignment -->
<s:HGroup verticalAlign="middle">
<s:Label text="Vertical align"/>
<s:DropDownList id="vAlign" requireSelection="true" color="0x000000">
<s:ArrayCollection>
<fx:String>bottom</fx:String>
<fx:String>middle</fx:String>
<fx:String>top</fx:String>
</s:ArrayCollection>
</s:DropDownList>
</s:HGroup>
<!-- The drop-down to select vertical alignment -->
<s:HGroup verticalAlign="middle">
<s:Label text="Horizontal align"/>
<s:DropDownList id="hAlign" requireSelection="true">
<s:ArrayCollection>
<fx:String>left</fx:String>
<fx:String>center</fx:String>
<fx:String>right</fx:String>
</s:ArrayCollection>
</s:DropDownList>
</s:HGroup>
<!-- The slider to control the list width -->
<s:HGroup verticalAlign="bottom">
<s:Label text="Container width"/>
<s:HSlider id="widthSlider" minimum="10" maximum="400"
value="200" liveDragging="true"/>
</s:HGroup>
<!-- The slider to control the horizontal gap -->
<s:HGroup verticalAlign="bottom">
<s:Label text="Horizontal gap"/>
<s:HSlider id="hGapSlider" minimum="0" maximum="50"
value="10" liveDragging="true"/>
</s:HGroup>
<!-- A Spark List -->
<s:List id="list1" width="{widthSlider.value}" height="112"
selectedIndex="7"
dataProvider="{new ArrayCollection(
'The quick fox jumped over the lazy sleepy\n\dog'.split(' '))}">
<!-- Configure the layout to be the FlowLayout -->
<s:layout>
<my:FlowLayout1 horizontalAlign="{hAlign.selectedItem}"
verticalAlign="{vAlign.selectedItem}"
horizontalGap="{hGapSlider.value}"/>
</s:layout>
</s:List>
</s:Panel>
</s:Module>