| <?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:Application |
| xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:comps="comps.*" |
| backgroundColor="0xFFFFFF" |
| width="550" height="750" |
| creationComplete="createAsDDL()"> |
| |
| <s:layout> |
| <s:VerticalLayout/> |
| </s:layout> |
| |
| <fx:Style> |
| @namespace s "library://ns.adobe.com/flex/spark"; |
| @namespace mx "library://ns.adobe.com/flex/mx"; |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Regular.ttf"); |
| fontFamily: myArial; |
| embedAsCFF: true; |
| } |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Regular.ttf"); |
| fontFamily: myArialHalo; |
| embedAsCFF: false; |
| } |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Bold.ttf"); |
| fontWeight: bold; |
| fontFamily: myArial; |
| embedAsCFF: true; |
| } |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Italic.ttf"); |
| fontStyle: italic; |
| fontFamily: myArial; |
| embedAsCFF: true; |
| } |
| |
| s|global{ |
| fontAntiAliasType: "normal"; |
| fontFamily: myArial; |
| fontLookup: "embeddedCFF"; |
| } |
| |
| mx|Label{ |
| fontAntiAliasType: "normal"; |
| fontFamily: myArialHalo; |
| } |
| </fx:Style> |
| |
| <fx:Script> |
| <![CDATA[ |
| import mx.collections.ArrayCollection; |
| |
| public var myTL_Array:Array = |
| [ |
| "Item n0", |
| "From n1", |
| "New n2", |
| "Array n3", |
| "To n4", |
| "Test n5", |
| "Adding n6", |
| ]; |
| |
| public var myAsDP_Array:Array = |
| [ |
| "First Item n0", |
| "From My n1", |
| "Array for n2", |
| "a DDL created n3", |
| "in ActionScript n4", |
| "Only in order n5", |
| "to verify that capability n6", |
| ]; |
| |
| [Bindable] |
| public var myTL_AC:ArrayCollection = new ArrayCollection(myTL_Array); |
| |
| [Bindable] |
| public var myAsDP:ArrayCollection = new ArrayCollection(myAsDP_Array); |
| |
| public function createAsDDL():void |
| { |
| var asDDL:DropDownList = new DropDownList(); |
| asDDL.width = 100; |
| asDDL.prompt= "AS DDL"; |
| asDDL.dataProvider = myAsDP; |
| addElement(asDDL); |
| } |
| |
| public function changeDP():void |
| { |
| myDDL1.dataProvider = myAsDP; |
| } |
| |
| ]]> |
| </fx:Script> |
| |
| <s:DropDownList id="myDDL" dataProvider="{myTL_AC}"/> |
| <mx:Label id="myDDL_Label" text="selectedIndex={myDDL.selectedIndex} selectedItem={myDDL.selectedItem}"/> |
| |
| <mx:Box paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5" id="focusBox"> |
| <comps:Custom_DDL1 id="myDDL1"/> |
| </mx:Box> |
| <mx:Label id="myDDL1_Label" text="selectedIndex={myDDL1.selectedIndex} selectedItem={myDDL1.selectedItem} caretIndex={myDDL1.caretIndex}"/> |
| |
| <comps:Custom_DDL2 id="myDDL2" /> |
| <mx:Label id="myDDL2_indexLabel" text="selectedIndex={myDDL2.selectedIndex}"/> |
| <mx:Label id="myDDL2_itemLabel" text="selectedItem={myDDL2.selectedItem}"/> |
| |
| <comps:Custom_DDL3 id="myDDL3" /> |
| <mx:Label id="myDDL3_Label" text="selectedIndex={myDDL3.selectedIndex} selectedItem={myDDL3.selectedItem}"/> |
| |
| <mx:HBox> |
| <comps:Custom_DDL4H id="myDDL4H" /> |
| <comps:Custom_DDL4T id="myDDL4T" /> |
| </mx:HBox> |
| <mx:Label id="myDDL4H_Label" text="selectedIndex={myDDL4H.selectedIndex} selectedItem={myDDL4H.selectedItem}"/> |
| <mx:Label id="myDDL4T_Label" text="selectedIndex={myDDL4T.selectedIndex} selectedItem={myDDL4T.selectedItem}"/> |
| |
| <comps:Custom_DDL5 id="myDDL5" /> |
| <mx:Label id="myDDL5_Label" text="selectedIndex={myDDL5.selectedIndex} selectedItem={myDDL5.selectedItem}"/> |
| |
| <comps:Custom_DDL6 id="myDDL6" /> |
| <mx:Label id="myDDL6_Label" text="selectedIndex={myDDL6.selectedIndex} selectedItem={myDDL6.selectedItem}"/> |
| |
| <mx:HBox> |
| <comps:Custom_DDL7 id="myDDL7" /> |
| <s:Button id="myBtn1" chromeColor="blue" label="Set selectedIndex=2" click="myDDL7.selectedIndex=2"/> |
| </mx:HBox> |
| <mx:Label id="myDDL7_Label" text="selectedIndex={myDDL7.selectedIndex} selectedItem={myDDL7.selectedItem}"/> |
| |
| <mx:HBox> |
| <comps:Custom_DDL8 id="myDDL8" /> |
| <s:Button id="myBtn2" chromeColor="blue" label="Set selectedItem=Two" click="myDDL8.selectedItem='Two'"/> |
| </mx:HBox> |
| <mx:Label id="myDDL8_Label" text="selectedIndex={myDDL8.selectedIndex} selectedItem={myDDL8.selectedItem}"/> |
| |
| <mx:HBox> |
| <s:NumericStepper id="myNS" minimum="-1" maximum="22" value="-1"/> |
| <comps:Custom_DDL9 id="myDDL9" selectedIndex="{myNS.value}"/> |
| </mx:HBox> |
| <mx:Label id="myDDL9_Label" text="selectedIndex={myDDL9.selectedIndex} selectedItem={myDDL9.selectedItem}"/> |
| |
| <comps:Custom_DDL10 id="myDDL10"/> |
| |
| <mx:HBox> |
| <comps:Custom_DDL_LabelField id="myDDL_LF" /> |
| <comps:Custom_DDL_LabelFunc id="myDDL_LFnc"/> |
| </mx:HBox> |
| |
| <comps:Custom_DDL1_disabled id="myDDL1_disabled"/> |
| |
| </s:Application> |