| <?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:Script> |
| <![CDATA[ |
| protected function clickHandler(event:MouseEvent):void |
| { |
| responseText.text = "Thank you for your purchase of " +this.numStepper.value + " tickets!"; |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Style> |
| @namespace "library://ns.adobe.com/flex/spark"; |
| @namespace mx "library://ns.adobe.com/flex/mx"; |
| #formHead { |
| fontSize: 18; |
| fontFamily: Arial; |
| fontWeight: bold; |
| } |
| mx|FormItem { |
| fontSize: 12; |
| fontFamily: Arial; |
| fontWeight: bold; |
| } |
| |
| </fx:Style> |
| |
| <s:Panel title="NumericStepper Sample" width="100%" height="100%"> |
| |
| <s:layout> |
| <s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10"/> |
| </s:layout> |
| |
| <s:Label width="250" verticalAlign="justify" |
| text="The NumericStepper control allows you to select a number from an |
| ordered set. The NumericStepper control consists of a single-line input text field and a pair of arrow buttons |
| for stepping through the valid values. You can use the Up Arrow and Down arrow keys to cycle through the values."/> |
| |
| <mx:Form> |
| <mx:FormHeading id="formHead" label="Welcome to Ticket Grabber!"/> |
| <mx:FormItem label="Name:"> |
| <s:TextInput id="nameTxt" widthInChars="20"/> |
| </mx:FormItem> |
| <mx:FormItem label="Address:"> |
| <s:TextArea widthInChars="20" heightInLines="2"/> |
| </mx:FormItem> |
| <mx:FormItem label="Phone:"> |
| <s:TextInput id="phoneTxt" widthInChars="20"/> |
| </mx:FormItem> |
| <mx:FormItem label="Select # of tickets:"> |
| <s:NumericStepper id="numStepper" width="55" |
| value="0" snapInterval="2"/> |
| </mx:FormItem> |
| <mx:FormItem> |
| <s:Button label="Buy Now!" click="clickHandler(event)"/> |
| </mx:FormItem> |
| <mx:FormItem> |
| <s:Group> |
| <s:Label id="responseText"/> |
| </s:Group> |
| </mx:FormItem> |
| </mx:Form> |
| |
| </s:Panel> |
| |
| </s:Module> |