| <?xml version="1.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. |
| |
| --> |
| <!-- Simple example to demonstrate the Spark Group component. --> |
| <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/mx" > |
| |
| <s:Panel title="Group Component Example" |
| width="75%" height="75%" |
| horizontalCenter="0" verticalCenter="0"> |
| <s:VGroup left="10" right="10" top="10" bottom="10"> |
| <s:Group> |
| <!-- use a vertical layout with a 1 pixel gap between items --> |
| <s:layout> |
| <s:VerticalLayout gap="1" /> |
| </s:layout> |
| |
| <s:Label text="Group with a vertical layout" /> |
| <s:Rect width="150" height="20"> |
| <s:fill> |
| <s:SolidColor color="0xE3E3E3" /> |
| </s:fill> |
| </s:Rect> |
| <s:Rect width="150" height="20"> |
| <s:fill> |
| <s:SolidColor color="0xCCCCCC" /> |
| </s:fill> |
| </s:Rect> |
| <s:Rect width="150" height="20"> |
| <s:fill> |
| <s:SolidColor color="0x888888" /> |
| </s:fill> |
| </s:Rect> |
| </s:Group> |
| |
| <mx:Spacer height="20" /> |
| |
| <s:Group> |
| <!-- use a horizontal layout with a 1 pixel gap between items --> |
| <s:layout> |
| <s:HorizontalLayout gap="1" /> |
| </s:layout> |
| |
| <s:Label text="Group with a horizontal layout" /> |
| <s:Rect width="25" height="25"> |
| <s:fill> |
| <s:SolidColor color="0xE3E3E3" /> |
| </s:fill> |
| </s:Rect> |
| <s:Rect width="25" height="25"> |
| <s:fill> |
| <s:SolidColor color="0xCCCCCC" /> |
| </s:fill> |
| </s:Rect> |
| <s:Rect width="25" height="25"> |
| <s:fill> |
| <s:SolidColor color="0x888888" /> |
| </s:fill> |
| </s:Rect> |
| </s:Group> |
| |
| <mx:Spacer height="20" /> |
| |
| <s:Group width="150" height="100"> |
| <!-- use the default basic layout where items are absolutely positioned --> |
| |
| <!-- add a background rectangle to stretch to fit the group --> |
| <s:Rect top="0" left="0" right="0" bottom="0"> |
| <s:fill> |
| <s:SolidColor color="0xCCCCCC" /> |
| </s:fill> |
| </s:Rect> |
| |
| <s:Label x="0" y="0" text="Group with a basic layout" /> |
| <s:Rect x="20" y="20" width="30" height="25"> |
| <s:fill> |
| <s:SolidColor color="0xE3E3E3" /> |
| </s:fill> |
| </s:Rect> |
| <s:Rect x="40" y="40" width="30" height="30"> |
| <s:fill> |
| <s:SolidColor color="0x888888" /> |
| </s:fill> |
| </s:Rect> |
| <s:Rect x="60" y="60" width="30" height="30"> |
| <s:fill> |
| <s:SolidColor color="0xBBBBBB" /> |
| </s:fill> |
| </s:Rect> |
| </s:Group> |
| </s:VGroup> |
| </s:Panel> |
| |
| </s:Application> |