| <?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. |
| |
| --> |
| <!-- Simple example to demonstrate the Spark PopUpAnchor component --> |
| <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark"> |
| |
| <fx:Style> |
| .popUpForm |
| { |
| contentBackgroundColor : #FF0000; |
| paddingTop : 2; |
| paddingBottom : 2; |
| paddingLeft : 2; |
| paddingRight : 2; |
| } |
| </fx:Style> |
| |
| <s:Panel width="75%" height="75%" title="My PopUpAnchor Example"> |
| |
| <!-- Group with default layout so that openBtn and PopUpAnchor will be on top of |
| each other such that the popUp can be positioned relative to the button --> |
| <s:Group x="10" y="10"> |
| <!-- Button used to open PopUp --> |
| <s:Button id="openBtn" label="Open PopUp" click="frmPUA.displayPopUp=true"/> |
| |
| <!-- PopUpAnchor component set to same size as openBtn to ensure that |
| popUp will be positioned relative to the button --> |
| <s:PopUpAnchor id="frmPUA" popUpPosition="below" styleName="popUpForm" width="92" height="21"> |
| <!-- BorderContainer to hold popUp contents --> |
| <s:BorderContainer> |
| <s:layout> |
| <s:VerticalLayout paddingTop="5" paddingLeft="5" paddingBottom="5" paddingRight="5"/> |
| </s:layout> |
| <s:Form> |
| <s:FormItem label="Name :"> |
| <s:TextInput/> |
| </s:FormItem> |
| <s:FormItem label="E-Mail :"> |
| <s:TextInput/> |
| </s:FormItem> |
| </s:Form> |
| <s:HGroup> |
| <!-- Button used to close popUp --> |
| <s:Button label="CLOSE" click="frmPUA.displayPopUp=false"/> |
| </s:HGroup> |
| </s:BorderContainer> |
| </s:PopUpAnchor> |
| </s:Group> |
| |
| </s:Panel> |
| </s:Application> |