blob: 7b4fc450ce37986e955a86cc831afb26191b4c83 [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/mx">
<fx:Declarations>
<fx:Array id="orientArray">
<fx:String>Rows</fx:String>
<fx:String>Columns</fx:String>
</fx:Array>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayList;
private function applyProperties():void
{
this.mainGroup.orientation = this.orientation.selectedItem;
this.mainGroup.horizontalGap = this.hgap.value;
this.mainGroup.verticalGap = this.vgap.value;
this.mainGroup.requestedColumnCount = this.colCount.value;
this.mainGroup.requestedRowCount = this.rowCount.value;
}
]]>
</fx:Script>
<s:Panel title="TileGroup Sample" width="100%" height="100%">
<s:TileGroup left="300" top="10" id="mainGroup">
<s:Rect width="100" height="75">
<s:fill>
<s:SolidColor color="0xd54f4f"/>
</s:fill>
</s:Rect>
<s:Rect width="100" height="75">
<s:fill>
<s:SolidColor color="0x2f977d"/>
</s:fill>
</s:Rect>
<s:Rect width="100" height="75">
<s:fill>
<s:SolidColor color="0xfffca2"/>
</s:fill>
</s:Rect>
</s:TileGroup>
<s:VGroup top="10" left="10">
<s:HGroup verticalAlign="middle">
<s:Label text="Orientation:"/>
<s:DropDownList id="orientation" dataProvider="{new ArrayList(orientArray)}" prompt="columns"/>
</s:HGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Horizontal Gap:"/>
<s:NumericStepper id="hgap" maximum="400"/>
</s:HGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Vertical Gap:"/>
<s:NumericStepper id="vgap" maximum="400"/>
</s:HGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Requested Column Count:"/>
<s:NumericStepper id="colCount"/>
</s:HGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Requested Row Count:"/>
<s:NumericStepper id="rowCount"/>
</s:HGroup>
<s:Button label="Apply Properties" click="this.applyProperties()"/>
<mx:Spacer height="10"/>
<s:Label width="85%" horizontalCenter="0"
text="The TileGroup container is an instance of the Group container that uses the TileLayout class. You can use the properties of the
TileGroup class to modify the characteristics of the TileLayout class."/>
</s:VGroup>
</s:Panel>
</s:Module>