| <?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. |
| |
| --> |
| <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:mx="library://ns.apache.org/royale/mx" |
| width="600" height="400" |
| layout="horizontal" > |
| <!-- to do: layout="absolute" minWidth="955" minHeight="600" --> |
| <fx:Style> |
| @namespace mx "library://ns.apache.org/royale/mx"; |
| |
| mx|Application { |
| horizontalGap: 50px; |
| } |
| |
| mx|HBox { |
| horizontalGap: 10px; |
| verticalAlign: middle; |
| } |
| |
| mx|VBox { |
| verticalGap: 10px; |
| horizontalAlign: middle; |
| } |
| </fx:Style> |
| |
| <fx:Script> |
| <![CDATA[ |
| import components.TitleWindowPopupWindowWithViewStack; |
| import mx.containers.TitleWindow; |
| import mx.managers.PopUpManager; |
| import mx.events.CloseEvent; |
| import mx.events.FlexEvent; |
| import org.apache.royale.events.Event; |
| |
| private function pushMePushed(event:MouseEvent):void { |
| trace("The PushMe button was pushed"); |
| } |
| |
| private function changeIcon():void { |
| button2.icon = "assets/mediumredrect.jpg"; |
| } |
| |
| private function otherPushMe():void { |
| trace("The other button was pushed"); |
| text1.htmlText = "The Button with an icon was pushed."; |
| dispatchEvent(new Event("layoutNeeded")); |
| } |
| |
| private function testTitleWindow():void { |
| var titleWindow:TitleWindow = new TitleWindow(); |
| titleWindow.width = 600; |
| titleWindow.height = 500; |
| titleWindow.title = "My TitleWindow"; |
| titleWindow.showCloseButton = true; |
| titleWindow.addEventListener(mx.events.CloseEvent.CLOSE, function (e:mx.events.CloseEvent):void{ |
| PopUpManager.removePopUp(titleWindow); |
| }) |
| PopUpManager.addPopUp(titleWindow, this, true); |
| PopUpManager.centerPopUp(titleWindow); |
| } |
| |
| private function testViewStack():void { |
| var test:TitleWindowPopupWindowWithViewStack = PopUpManager.createPopUp(this,TitleWindowPopupWindowWithViewStack) as TitleWindowPopupWindowWithViewStack; |
| test.addEventListener(mx.events.CloseEvent.CLOSE, close); |
| //@todo implement and test other child creationPolicies... |
| test.childCreationPolicyTest = 'none'; |
| test.title = "ViewStack with creationPolicy test:"+test.childCreationPolicyTest; |
| PopUpManager.centerPopUp(test); |
| |
| function close(event:mx.events.CloseEvent):void{ |
| PopUpManager.removePopUp(test) |
| } |
| } |
| ]]> |
| </fx:Script> |
| <mx:Canvas width="300" height="100" backgroundColor="yellow"> |
| <mx:Label text="left:2 right:2 top:2" left="2" right="2" top="2" backgroundColor="white"/> |
| <mx:Label text="left:10 right:40 top:40" left="10" right="40" top="40" backgroundColor="white"/> |
| <mx:Label text="left:40 right:40 top:80" left="40" right="40" top="80" backgroundColor="white" /> |
| </mx:Canvas> |
| <mx:VBox id="vbox1"> |
| <mx:Label text="Hello World"/> |
| <mx:Button label="Change Icon" click="changeIcon()" |
| toolTip="Changes the icon in the button below." /> |
| <mx:Button id="button2" label="Make Shorter" icon="assets/smallgreenrect.jpg" |
| click="otherPushMe()" toolTip="Makes the text below a lot shorter."/> |
| <mx:Image source="assets/mediumredrect.jpg" toolTip="Green Square" /> |
| <mx:NumericStepper minimum="50" maximum="100" value="75" /> |
| <mx:Spacer height="30" /> |
| <mx:Text id="text1" toolTip="More than meets the eye."> |
| <mx:htmlText><![CDATA[ |
| This is <b>Text!</b> This more than a few words in it to show how |
| it works and <b>wraps</b>. |
| ]]></mx:htmlText> |
| </mx:Text> |
| </mx:VBox> |
| <mx:HBox id="hbox1"> |
| <mx:Label text="Hello World"/> |
| <mx:LinkButton label="Apache.org" /> |
| <mx:Button label="Push Me Longer Title" toolTip="I do nothing" /> |
| <mx:Button label="Green Icon Button" className="GreenButton" icon="assets/smallgreenrect.jpg" toolTip="I also do nothing" /> |
| <mx:Image source="assets/mediumredrect.jpg" toolTip="Green Square" /> |
| </mx:HBox> |
| <mx:Canvas width="300" height="300"> |
| <mx:Label text="At 0,0" x="0" y="0" /> |
| <mx:Label text="At 100,100" x="100" y="100" /> |
| <mx:Label text="At 200,200" x="200" y="200" /> |
| </mx:Canvas> |
| <mx:TextArea text="This is the TextArea control!" |
| maxChars="100"/> |
| <mx:Button label="Launch TitleWindow" click="testTitleWindow()" |
| toolTip="launchs a test TitleWindow" /> |
| <mx:Button label="Launch ViewStack" click="testViewStack()" |
| toolTip="launchs a test ViewStack with LinkBar" /> |
| |
| </mx:Application> |