http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/printing/PrintDataGridExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/printing/PrintDataGridExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/printing/PrintDataGridExample.mxml new file mode 100755 index 0000000..d3ef7e9 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/printing/PrintDataGridExample.mxml @@ -0,0 +1,143 @@ +<?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. + --> + +<!-- Main application to print a DataGrid control on multiple pages. --> + +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" initialize="initData();"> + + <fx:Script> + <![CDATA[ + + import mx.core.FlexGlobals; + import mx.printing.*; + import mx.collections.ArrayCollection; + import FormPrintView; + + // Declare variables and initialize simple variables. + [Bindable] + public var dgProvider:ArrayCollection; + public var footerHeight:Number = 20; + public var prodIndex:Number; + public var prodTotal:Number = 0; + + // Data initialization. + public function initData():void { + // Create the data provider for the DataGrid control. + dgProvider = new ArrayCollection; + } + + // Fill the dgProvider ArrayCollection with the specified items. + public function setdgProvider(items:int):void { + + prodIndex=1; + dgProvider.removeAll(); + for (var z:int=0; z<items; z++) + { + var prod1:Object = {}; + prod1.Qty = prodIndex * 7; + prod1.Index = prodIndex++; + prodTotal += prod1.Qty; + dgProvider.addItem(prod1); + } + } + + // The function to print the output. + public function doPrint():void { + + var printJob:FlexPrintJob = new FlexPrintJob(); + if (printJob.start()) { + // Create a FormPrintView control as a child of the current view. + var thePrintView:FormPrintView = new FormPrintView(); + FlexGlobals.topLevelApplication.addChild(thePrintView); + + //Set the print view properties. + thePrintView.width=printJob.pageWidth; + thePrintView.height=printJob.pageHeight; + thePrintView.prodTotal = prodTotal; + // Set the data provider of the FormPrintView component's data grid + // to be the data provider of the displayed data grid. + thePrintView.myDataGrid.dataProvider = myDataGrid.dataProvider; + // Create a single-page image. + thePrintView.showPage("single"); + // If the print image's data grid can hold all the provider's rows, + // add the page to the print job. + if(!thePrintView.myDataGrid.validNextPage) + { + printJob.addObject(thePrintView); + } + // Otherwise, the job requires multiple pages. + else + { + // Create the first page and add it to the print job. + thePrintView.showPage("first"); + printJob.addObject(thePrintView); + thePrintView.pageNumber++; + // Loop through the following code until all pages are queued. + while(true) + { + // Move the next page of data to the top of the print grid. + thePrintView.myDataGrid.nextPage(); + thePrintView.showPage("last"); + // If the page holds the remaining data, or if the last page + // was completely filled by the last grid data, queue it for printing. + // Test if there is data for another PrintDataGrid page. + if(!thePrintView.myDataGrid.validNextPage) + { + // This is the last page; queue it and exit the print loop. + printJob.addObject(thePrintView); + break; + } + else + // This is not the last page. Queue a middle page. + { + thePrintView.showPage("middle"); + printJob.addObject(thePrintView); + thePrintView.pageNumber++; + } + } + } + // All pages are queued; remove the FormPrintView control to free memory. + FlexGlobals.topLevelApplication.removeChild(thePrintView); + } + // Send the job to the printer. + printJob.send(); + } + ]]> + </fx:Script> + + <mx:Panel title="DataGrid Printing Example" height="75%" width="75%" + paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> + + <mx:DataGrid id="myDataGrid" dataProvider="{dgProvider}"> + <mx:columns> + <mx:DataGridColumn dataField="Index"/> + <mx:DataGridColumn dataField="Qty"/> + </mx:columns> + </mx:DataGrid> + + <mx:Text width="100%" color="blue" + text="Specify the number of lines and click Fill Grid first. Then you can click Print."/> + + <mx:TextInput id="dataItems" text="35"/> + + <mx:HBox> + <mx:Button id="setDP" label="Fill Grid" click="setdgProvider(int(dataItems.text));"/> + <mx:Button id="printDG" label="Print" click="doPrint();"/> + </mx:HBox> + </mx:Panel> +</mx:Application> \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/states/StatesExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/states/StatesExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/states/StatesExample.mxml new file mode 100755 index 0000000..d0f70b1 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/states/StatesExample.mxml @@ -0,0 +1,56 @@ +<?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 States class. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <!-- Define one view state, in addition to the base state.--> + <mx:states> + <mx:State name="default" /> + <mx:State name="register" /> + </mx:states> + + <!-- Define a Panel container that defines the login form.--> + <mx:Panel title="Login" title.register="Register" id="loginPanel" + horizontalScrollPolicy="off" verticalScrollPolicy="off" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Text width="100%" color="blue" + text="Click the 'Need to Register?' link to change state. Click the 'Return to Login' link to return to the base state."/> + + <mx:Form id="loginForm"> + <mx:FormItem label="Username:"> + <mx:TextInput/> + </mx:FormItem> + <mx:FormItem label="Password:"> + <mx:TextInput/> + </mx:FormItem> + <mx:FormItem id="confirm" label="Confirm:" includeIn="register"> + <mx:TextInput/> + </mx:FormItem> + </mx:Form> + <mx:ControlBar> + <mx:LinkButton id="registerLink" label="Need to Register?" + click="currentState='register'" excludeFrom="register"/> + <mx:LinkButton id="loginLink" label="Return to Login" click="currentState='default'" + includeIn="register" /> + <mx:Spacer width="100%" id="spacer1"/> + <mx:Button label="Login" label.register="register" color.register="blue" id="loginButton" /> + </mx:ControlBar> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/states/TransitionExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/states/TransitionExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/states/TransitionExample.mxml new file mode 100755 index 0000000..a246307 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/states/TransitionExample.mxml @@ -0,0 +1,82 @@ +<?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 Transition class. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <!-- Define one view state, in addition to the base state.--> + <mx:states> + <mx:State name="default" /> + <mx:State name="register" /> + </mx:states> + + <mx:transitions> + <!-- Define the transition from the base state to the Register state.--> + <mx:Transition id="toRegister" fromState="default" toState="register"> + <mx:Sequence targets="{[loginPanel, registerLink, confirm, loginLink, spacer1]}"> + <mx:RemoveChildAction/> + <mx:SetPropertyAction target="{loginPanel}" name="title"/> + <mx:SetPropertyAction target="{loginButton}" name="label"/> + <mx:SetStyleAction target="{loginButton}" name="color"/> + <mx:Resize target="{loginPanel}"/> + <mx:AddChildAction/> + </mx:Sequence> + </mx:Transition> + + <!-- Define the transition from the Register state to the base state.--> + <mx:Transition id="toDefault" fromState="register" toState="default"> + <mx:Sequence targets="{[loginPanel, registerLink, confirm, loginLink, spacer1]}"> + <mx:RemoveChildAction/> + <mx:SetPropertyAction target="{loginPanel}" name="title"/> + <mx:SetPropertyAction target="{loginButton}" name="label"/> + <mx:SetStyleAction target="{loginButton}" name="color"/> + <mx:Resize target="{loginPanel}"/> + <mx:AddChildAction/> + </mx:Sequence> + </mx:Transition> + </mx:transitions> + + <!-- Define a Panel container that defines the login form.--> + <mx:Panel title="Login" title.register="Register" id="loginPanel" + horizontalScrollPolicy="off" verticalScrollPolicy="off" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Text width="100%" color="blue" + text="Click the 'Need to Register?' link to change state. Click the 'Return to Login' link to return to the base state."/> + + <mx:Form id="loginForm"> + <mx:FormItem label="Username:"> + <mx:TextInput/> + </mx:FormItem> + <mx:FormItem label="Password:"> + <mx:TextInput/> + </mx:FormItem> + <mx:FormItem id="confirm" label="Confirm:" includeIn="register"> + <mx:TextInput/> + </mx:FormItem> + </mx:Form> + <mx:ControlBar> + <mx:LinkButton id="registerLink" label="Need to Register?" + click="currentState='register'" excludeFrom="register"/> + <mx:LinkButton id="loginLink" label="Return to Login" click="currentState='default'" + includeIn="register" /> + <mx:Spacer width="100%" id="spacer1"/> + <mx:Button label="Login" label.register="register" color.register="blue" id="loginButton" /> + </mx:ControlBar> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/CreditCardValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/CreditCardValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/CreditCardValidatorExample.mxml new file mode 100755 index 0000000..cbf97a5 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/CreditCardValidatorExample.mxml @@ -0,0 +1,68 @@ +<?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 CreditCardValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <!-- Define model for the credit card data. --> + <fx:Model id="creditcard"> + <card> + <cardType>{cardTypeCombo.selectedItem.data}</cardType> + <cardNumber>{cardNumberInput.text}</cardNumber> + </card> + </fx:Model> + + <mx:CreditCardValidator id="ccV" + cardTypeSource="{creditcard}" cardTypeProperty="cardType" + cardNumberSource="{creditcard}" cardNumberProperty="cardNumber" + trigger="{myButton}" triggerEvent="click" + cardTypeListener="{cardTypeCombo}" + cardNumberListener="{cardNumberInput}" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="CreditCardValidator Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form id="creditCardForm"> + <mx:FormItem label="Card Type"> + <mx:ComboBox id="cardTypeCombo"> + <mx:dataProvider> + <fx:Object label="American Express" data="American Express"/> + <fx:Object label="Diners Club" data="Diners Club"/> + <fx:Object label="Discover" data="Discover"/> + <fx:Object label="MasterCard" data="MasterCard"/> + <fx:Object label="Visa" data="Visa"/> + </mx:dataProvider> + </mx:ComboBox> + </mx:FormItem> + <mx:FormItem label="Credit Card Number"> + <mx:TextInput id="cardNumberInput"/> + </mx:FormItem> + <mx:FormItem> + <mx:Button id="myButton" label="Check Credit"/> + </mx:FormItem> + </mx:Form> + + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/CurrencyValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/CurrencyValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/CurrencyValidatorExample.mxml new file mode 100755 index 0000000..d937c34 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/CurrencyValidatorExample.mxml @@ -0,0 +1,45 @@ +<?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 CurrencyValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <mx:CurrencyValidator source="{priceUS}" property="text" precision="2" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="CurrencyValidator Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter a U.S. dollar amount: "> + <mx:TextInput id="priceUS" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate"/> + </mx:FormItem> + </mx:Form> + </mx:Panel> +</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/DateValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/DateValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/DateValidatorExample.mxml new file mode 100755 index 0000000..17293a9 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/DateValidatorExample.mxml @@ -0,0 +1,52 @@ +<?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 DateValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <fx:Model id="CheckModel"> + <dateInfo> + <DOB>{dob.text}</DOB> + </dateInfo> + </fx:Model> + + <mx:DateValidator source="{dob}" property="text" allowedFormatChars="/" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="DateValidator Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter date of birth (mm/dd/yyyy): "> + <mx:TextInput id="dob" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate" /> + </mx:FormItem> + </mx:Form> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/EmailValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/EmailValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/EmailValidatorExample.mxml new file mode 100755 index 0000000..558971f --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/EmailValidatorExample.mxml @@ -0,0 +1,45 @@ +<?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 EmailValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <mx:EmailValidator source="{email}" property="text" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="EmailValidator Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter an e-mail address: "> + <mx:TextInput id="email" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate" /> + </mx:FormItem> + </mx:Form> + </mx:Panel> + </mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/NumberValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/NumberValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/NumberValidatorExample.mxml new file mode 100755 index 0000000..979ce17 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/NumberValidatorExample.mxml @@ -0,0 +1,46 @@ +<?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 NumberValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <mx:NumberValidator source="{age}" property="text" integerError="Enter Integer value" + minValue="18" maxValue="50" domain="int" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="NumberValidator Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter an age between 18 and 50: "> + <mx:TextInput id="age" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate" /> + </mx:FormItem> + </mx:Form> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/PhoneNumberValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/PhoneNumberValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/PhoneNumberValidatorExample.mxml new file mode 100755 index 0000000..309802b --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/PhoneNumberValidatorExample.mxml @@ -0,0 +1,45 @@ +<?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 PhoneNumberValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <mx:PhoneNumberValidator source="{phone}" property="text" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="Phone Number Validator Panel" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter 10-digit phone number: "> + <mx:TextInput id="phone" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate" /> + </mx:FormItem> + </mx:Form> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/RegExValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/RegExValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/RegExValidatorExample.mxml new file mode 100755 index 0000000..8ee9cf9 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/RegExValidatorExample.mxml @@ -0,0 +1,85 @@ +<?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 RegExpValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + import mx.events.ValidationResultEvent; + import mx.validators.*; + + // Write the results to the + private function handleResult(eventObj:ValidationResultEvent):void { + if (eventObj.type == ValidationResultEvent.VALID) + { + // For valid events, the results Array contains + // RegExpValidationResult objects. + var xResult:RegExpValidationResult; + reResults.text=""; + for (var i:uint = 0; i < eventObj.results.length; i++) + { + xResult = eventObj.results[i]; + reResults.text=reResults.text + xResult.matchedIndex + " " + + xResult.matchedString + "\n"; + } + } + else + { + reResults.text=""; + } + } + ]]> + </fx:Script> + + <fx:Declarations> + <mx:RegExpValidator id="regExpV" + source="{regex_text}" property="text" + flags="g" expression="{regex.text}" + valid="handleResult(event)" invalid="handleResult(event)" + trigger="{myButton}" triggerEvent="click"/> + </fx:Declarations> + + <mx:Panel title="RegExpValidator Example" width="95%" height="95%" + paddingTop="5" paddingLeft="5" paddingRight="5" paddingBottom="5"> + + <mx:Text width="100%" text="Instructions:"/> + <mx:Text width="100%" text="1. Enter text to search. By default, enter a string containing the letters ABC in sequence followed by any digit."/> + <mx:Text width="100%" text="2. Enter the regular expression. By default, enter ABC\d."/> + <mx:Text width="100%" text="3. Click the Button control to trigger the validation."/> + <mx:Text width="100%" text="4. The results show the index in the text where the matching pattern begins, and the matching pattern. "/> + + <mx:Form> + <mx:FormItem label="Enter text: "> + <mx:TextInput id="regex_text" text="xxxxABC4xxx" width="100%"/> + </mx:FormItem> + + <mx:FormItem label="Enter regular expression: "> + <mx:TextInput id="regex" text="ABC\d" width="100%"/> + </mx:FormItem> + + <mx:FormItem label="Results: "> + <mx:TextInput id="reResults" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate"/> + </mx:FormItem> + </mx:Form> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/SimpleValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/SimpleValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/SimpleValidatorExample.mxml new file mode 100755 index 0000000..120574e --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/SimpleValidatorExample.mxml @@ -0,0 +1,76 @@ +<?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 Validator class. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + <![CDATA[ + + // Import necessary classes. + import mx.controls.Alert; + import mx.events.ValidationResultEvent; + + // Event listener for the valid and invalid events. + private function handleValid(eventObj:ValidationResultEvent):void { + if(eventObj.type==ValidationResultEvent.VALID) + // Enable Submit button. + submitButton.enabled = true; + else + submitButton.enabled = false; + } + + // Submit form is everything is valid. + private function submitForm():void { + Alert.show("Form Submitted!"); + } + + ]]> + </fx:Script> + + <!-- The Validator class defines the required property and the validator events + used by all validator subclasses. --> + <fx:Declarations> + <mx:Validator id="reqValid" required="true" + source="{fname}" property="text" + valid="handleValid(event)" invalid="handleValid(event)"/> + </fx:Declarations> + + <mx:Panel title="Validator Example" width="100%" height="100%" + paddingTop="5" paddingLeft="5" paddingRight="5" paddingBottom="5"> + + <mx:Form> + <mx:Text width="100%" color="blue" + text="Enter a value in the Name field before you can submit. The E-mail field is optional."/> + + <mx:FormItem label="Name: " required="true"> + <mx:TextInput id="fname" width="100%"/> + </mx:FormItem> + + <mx:FormItem label="E-mail address: " required="false"> + <mx:TextInput id="email" width="100%"/> + </mx:FormItem> + + <mx:FormItem> + <mx:Button id="submitButton" enabled="false" + label="Submit" click="submitForm();"/> + </mx:FormItem> + </mx:Form> + + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/SocialSecurityValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/SocialSecurityValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/SocialSecurityValidatorExample.mxml new file mode 100755 index 0000000..92cd7cf --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/SocialSecurityValidatorExample.mxml @@ -0,0 +1,45 @@ +<?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 SocialSecurityValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <mx:SocialSecurityValidator source="{ssn}" property="text" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="Social Security Validator Panel" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter Social Security number: "> + <mx:TextInput id="ssn" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate" /> + </mx:FormItem> + </mx:Form> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/StringValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/StringValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/StringValidatorExample.mxml new file mode 100755 index 0000000..6e0e655 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/StringValidatorExample.mxml @@ -0,0 +1,48 @@ +<?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 StringValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <mx:StringValidator source="{fname}" property="text" + tooShortError="This string is shorter than the minimum allowed length of 4. " + tooLongError="This string is longer than the maximum allowed length of 20." + minLength="4" maxLength="20" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="StringValidator Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter a name between 4 and 20 characters: "> + <mx:TextInput id="fname" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate" /> + </mx:FormItem> + </mx:Form> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/mx/validators/ZipCodeValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/mx/validators/ZipCodeValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/mx/validators/ZipCodeValidatorExample.mxml new file mode 100755 index 0000000..b5375ef --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/mx/validators/ZipCodeValidatorExample.mxml @@ -0,0 +1,45 @@ +<?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 ZipCodeValidator. --> +<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> + + <fx:Script> + import mx.controls.Alert; + </fx:Script> + + <fx:Declarations> + <mx:ZipCodeValidator source="{zip}" property="text" + trigger="{myButton}" triggerEvent="click" + valid="Alert.show('Validation Succeeded!');"/> + </fx:Declarations> + + <mx:Panel title="ZipcodeValidator Example" width="75%" height="75%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + + <mx:Form> + <mx:FormItem label="Enter a 5 or 9 digit U.S. Zip code: "> + <mx:TextInput id="zip" width="100%"/> + </mx:FormItem> + + <mx:FormItem > + <mx:Button id="myButton" label="Validate" /> + </mx:FormItem> + </mx:Form> + </mx:Panel> +</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/printing/AdvancedPrintDataGridExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/printing/AdvancedPrintDataGridExample.mxml b/TourDeFlex/TourDeFlex3/src/printing/AdvancedPrintDataGridExample.mxml deleted file mode 100755 index 69ccd97..0000000 --- a/TourDeFlex/TourDeFlex3/src/printing/AdvancedPrintDataGridExample.mxml +++ /dev/null @@ -1,105 +0,0 @@ -<?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. - --> - -<!-- printing\ADGPrint.mxml --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - <![CDATA[ - import mx.printing.*; - import mx.collections.ArrayCollection; - import mx.printing.PrintAdvancedDataGrid; - - // Create a PrintJob instance. - private function doPrint():void { - // Create an instance of the FlexPrintJob class. - var printJob:FlexPrintJob = new FlexPrintJob(); - - // Initialize the PrintAdvancedDataGrid control. - var printADG:PrintAdvancedDataGrid = - new PrintAdvancedDataGrid(); - // Exclude the PrintAdvancedDataGrid control from layout. - printADG.includeInLayout = false; - printADG.source = adg; - - // Add the print-specific control to the application. - addChild(printADG); - - // Start the print job. - if (printJob.start() == false) { - // User cancelled print job. - // Remove the print-specific control to free memory. - removeChild(printADG); - return; - } - - // Add the object to print. Do not scale it. - printJob.addObject(printADG, FlexPrintJobScaleType.NONE); - - // Send the job to the printer. - printJob.send(); - - // Remove the print-specific control to free memory. - removeChild(printADG); - } - - [Bindable] - private var dpHierarchy:ArrayCollection = new ArrayCollection([ - {Region:"Southwest", children: [ - {Region:"Arizona", children: [ - {Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, - {Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}]}, - {Region:"Central California", children: [ - {Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}]}, - {Region:"Nevada", children: [ - {Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}]}, - {Region:"Northern California", children: [ - {Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, - {Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}]}, - {Region:"Southern California", children: [ - {Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, - {Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}]} - ]} - ]); - - ]]> - </fx:Script> - - <mx:Panel title="PrintAdvancedDataGrid Control Example" - height="75%" width="75%" layout="horizontal" - paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> - - <mx:AdvancedDataGrid id="adg" - width="100%" height="100%"> - <mx:dataProvider> - <mx:HierarchicalData source="{dpHierarchy}"/> - </mx:dataProvider> - <mx:columns> - <mx:AdvancedDataGridColumn dataField="Region"/> - <mx:AdvancedDataGridColumn dataField="Territory_Rep" - headerText="Territory Rep"/> - <mx:AdvancedDataGridColumn dataField="Actual"/> - <mx:AdvancedDataGridColumn dataField="Estimate"/> - </mx:columns> - </mx:AdvancedDataGrid> - - <mx:Button id="myButton" - label="Print" - click="doPrint();"/> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/printing/FormPrintFooter.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/printing/FormPrintFooter.mxml b/TourDeFlex/TourDeFlex3/src/printing/FormPrintFooter.mxml deleted file mode 100755 index ef1ed8c..0000000 --- a/TourDeFlex/TourDeFlex3/src/printing/FormPrintFooter.mxml +++ /dev/null @@ -1,32 +0,0 @@ -<?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. - --> - -<!-- Custom control for the footer area of the printed page. --> - -<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" - width="60%" horizontalAlign="right" > - <!-- Declare and initialize the product total variable. --> - - <fx:Script> - <![CDATA[ - [Bindable] - public var pTotal:Number = 0; - ]]> - </fx:Script> - <mx:Label text="Product Total: {pTotal}"/> -</mx:VBox> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/printing/FormPrintHeader.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/printing/FormPrintHeader.mxml b/TourDeFlex/TourDeFlex3/src/printing/FormPrintHeader.mxml deleted file mode 100755 index 37e74b3..0000000 --- a/TourDeFlex/TourDeFlex3/src/printing/FormPrintHeader.mxml +++ /dev/null @@ -1,25 +0,0 @@ -<?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. - --> - -<!-- Custom control for the header area of the printed page. --> - -<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" - width="60%" horizontalAlign="right" > - - <mx:Label text="This is a placeholder for first page contents"/> -</mx:VBox> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/printing/FormPrintView.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/printing/FormPrintView.mxml b/TourDeFlex/TourDeFlex3/src/printing/FormPrintView.mxml deleted file mode 100755 index 3adb70d..0000000 --- a/TourDeFlex/TourDeFlex3/src/printing/FormPrintView.mxml +++ /dev/null @@ -1,77 +0,0 @@ -<?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. - --> - -<!-- Custom control to print the DataGrid control on multiple pages. --> - -<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" - xmlns="*" backgroundColor="#FFFFFF" paddingTop="50" paddingBottom="50" paddingLeft="50"> - - <fx:Script> - <![CDATA[ - import mx.core.* - // Declare and initialize the variables used in the component. - // The application sets the actual prodTotal value. - [Bindable] - public var pageNumber:Number = 1; - [Bindable] - public var prodTotal:Number = 0; - - // Control the page contents by selectively hiding the header and - // footer based on the page type. - public function showPage(pageType:String):void { - if(pageType == "first" || pageType == "middle") { - // Hide the footer. - footer.includeInLayout=false; - footer.visible = false; - } - if(pageType == "middle" || pageType == "last") { - // The header won't be used again; hide it. - header.includeInLayout=false; - header.visible = false; - } - if(pageType == "last") { - // Show the footer. - footer.includeInLayout=true; - footer.visible = true; - } - //Update the DataGrid layout to reflect the results. - validateNow(); - } - ]]> - </fx:Script> - - <!-- The template for the printed page, with the contents for all pages. --> - <mx:VBox width="80%" horizontalAlign="left"> - <mx:Label text="Page {pageNumber}"/> - </mx:VBox> - - <FormPrintHeader id="header" /> - <!-- The data grid. The sizeToPage property is true by default, so the last - page has only as many grid rows as are needed for the data. --> - <mx:PrintDataGrid id="myDataGrid" width="60%" height="100%"> - <!-- Specify the columns to ensure that their order is correct. --> - <mx:columns> - <mx:DataGridColumn dataField="Index" /> - <mx:DataGridColumn dataField="Qty" /> - </mx:columns> - </mx:PrintDataGrid> - - <!-- Create a FormPrintFooter control and set its prodTotal variable. --> - <FormPrintFooter id="footer" pTotal="{prodTotal}" /> - -</mx:VBox> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/printing/PrintDataGridExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/printing/PrintDataGridExample.mxml b/TourDeFlex/TourDeFlex3/src/printing/PrintDataGridExample.mxml deleted file mode 100755 index 375068b..0000000 --- a/TourDeFlex/TourDeFlex3/src/printing/PrintDataGridExample.mxml +++ /dev/null @@ -1,143 +0,0 @@ -<?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. - --> - -<!-- Main application to print a DataGrid control on multiple pages. --> - -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" initialize="initData();"> - - <fx:Script> - <![CDATA[ - - import mx.core.FlexGlobals; - import mx.printing.*; - import mx.collections.ArrayCollection; - import FormPrintView; - - // Declare variables and initialize simple variables. - [Bindable] - public var dgProvider:ArrayCollection; - public var footerHeight:Number = 20; - public var prodIndex:Number; - public var prodTotal:Number = 0; - - // Data initialization. - public function initData():void { - // Create the data provider for the DataGrid control. - dgProvider = new ArrayCollection; - } - - // Fill the dgProvider ArrayCollection with the specified items. - public function setdgProvider(items:int):void { - - prodIndex=1; - dgProvider.removeAll(); - for (var z:int=0; z<items; z++) - { - var prod1:Object = {}; - prod1.Qty = prodIndex * 7; - prod1.Index = prodIndex++; - prodTotal += prod1.Qty; - dgProvider.addItem(prod1); - } - } - - // The function to print the output. - public function doPrint():void { - - var printJob:FlexPrintJob = new FlexPrintJob(); - if (printJob.start()) { - // Create a FormPrintView control as a child of the current view. - var thePrintView:FormPrintView = new FormPrintView(); - FlexGlobals.topLevelApplication.addChild(thePrintView); - - //Set the print view properties. - thePrintView.width=printJob.pageWidth; - thePrintView.height=printJob.pageHeight; - thePrintView.prodTotal = prodTotal; - // Set the data provider of the FormPrintView component's data grid - // to be the data provider of the displayed data grid. - thePrintView.myDataGrid.dataProvider = myDataGrid.dataProvider; - // Create a single-page image. - thePrintView.showPage("single"); - // If the print image's data grid can hold all the provider's rows, - // add the page to the print job. - if(!thePrintView.myDataGrid.validNextPage) - { - printJob.addObject(thePrintView); - } - // Otherwise, the job requires multiple pages. - else - { - // Create the first page and add it to the print job. - thePrintView.showPage("first"); - printJob.addObject(thePrintView); - thePrintView.pageNumber++; - // Loop through the following code until all pages are queued. - while(true) - { - // Move the next page of data to the top of the print grid. - thePrintView.myDataGrid.nextPage(); - thePrintView.showPage("last"); - // If the page holds the remaining data, or if the last page - // was completely filled by the last grid data, queue it for printing. - // Test if there is data for another PrintDataGrid page. - if(!thePrintView.myDataGrid.validNextPage) - { - // This is the last page; queue it and exit the print loop. - printJob.addObject(thePrintView); - break; - } - else - // This is not the last page. Queue a middle page. - { - thePrintView.showPage("middle"); - printJob.addObject(thePrintView); - thePrintView.pageNumber++; - } - } - } - // All pages are queued; remove the FormPrintView control to free memory. - FlexGlobals.topLevelApplication.removeChild(thePrintView); - } - // Send the job to the printer. - printJob.send(); - } - ]]> - </fx:Script> - - <mx:Panel title="DataGrid Printing Example" height="75%" width="75%" - paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> - - <mx:DataGrid id="myDataGrid" dataProvider="{dgProvider}"> - <mx:columns> - <mx:DataGridColumn dataField="Index"/> - <mx:DataGridColumn dataField="Qty"/> - </mx:columns> - </mx:DataGrid> - - <mx:Text width="100%" color="blue" - text="Specify the number of lines and click Fill Grid first. Then you can click Print."/> - - <mx:TextInput id="dataItems" text="35"/> - - <mx:HBox> - <mx:Button id="setDP" label="Fill Grid" click="setdgProvider(int(dataItems.text));"/> - <mx:Button id="printDG" label="Print" click="doPrint();"/> - </mx:HBox> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/states/StatesExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/states/StatesExample.mxml b/TourDeFlex/TourDeFlex3/src/states/StatesExample.mxml deleted file mode 100755 index 291784a..0000000 --- a/TourDeFlex/TourDeFlex3/src/states/StatesExample.mxml +++ /dev/null @@ -1,56 +0,0 @@ -<?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 States class. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <!-- Define one view state, in addition to the base state.--> - <mx:states> - <mx:State name="default" /> - <mx:State name="register" /> - </mx:states> - - <!-- Define a Panel container that defines the login form.--> - <mx:Panel title="Login" title.register="Register" id="loginPanel" - horizontalScrollPolicy="off" verticalScrollPolicy="off" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Text width="100%" color="blue" - text="Click the 'Need to Register?' link to change state. Click the 'Return to Login' link to return to the base state."/> - - <mx:Form id="loginForm"> - <mx:FormItem label="Username:"> - <mx:TextInput/> - </mx:FormItem> - <mx:FormItem label="Password:"> - <mx:TextInput/> - </mx:FormItem> - <mx:FormItem id="confirm" label="Confirm:" includeIn="register"> - <mx:TextInput/> - </mx:FormItem> - </mx:Form> - <mx:ControlBar> - <mx:LinkButton id="registerLink" label="Need to Register?" - click="currentState='register'" excludeFrom="register"/> - <mx:LinkButton id="loginLink" label="Return to Login" click="currentState='default'" - includeIn="register" /> - <mx:Spacer width="100%" id="spacer1"/> - <mx:Button label="Login" label.register="register" color.register="blue" id="loginButton" /> - </mx:ControlBar> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/states/TransitionExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/states/TransitionExample.mxml b/TourDeFlex/TourDeFlex3/src/states/TransitionExample.mxml deleted file mode 100755 index 0f22f95..0000000 --- a/TourDeFlex/TourDeFlex3/src/states/TransitionExample.mxml +++ /dev/null @@ -1,82 +0,0 @@ -<?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 Transition class. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <!-- Define one view state, in addition to the base state.--> - <mx:states> - <mx:State name="default" /> - <mx:State name="register" /> - </mx:states> - - <mx:transitions> - <!-- Define the transition from the base state to the Register state.--> - <mx:Transition id="toRegister" fromState="default" toState="register"> - <mx:Sequence targets="{[loginPanel, registerLink, confirm, loginLink, spacer1]}"> - <mx:RemoveChildAction/> - <mx:SetPropertyAction target="{loginPanel}" name="title"/> - <mx:SetPropertyAction target="{loginButton}" name="label"/> - <mx:SetStyleAction target="{loginButton}" name="color"/> - <mx:Resize target="{loginPanel}"/> - <mx:AddChildAction/> - </mx:Sequence> - </mx:Transition> - - <!-- Define the transition from the Register state to the base state.--> - <mx:Transition id="toDefault" fromState="register" toState="default"> - <mx:Sequence targets="{[loginPanel, registerLink, confirm, loginLink, spacer1]}"> - <mx:RemoveChildAction/> - <mx:SetPropertyAction target="{loginPanel}" name="title"/> - <mx:SetPropertyAction target="{loginButton}" name="label"/> - <mx:SetStyleAction target="{loginButton}" name="color"/> - <mx:Resize target="{loginPanel}"/> - <mx:AddChildAction/> - </mx:Sequence> - </mx:Transition> - </mx:transitions> - - <!-- Define a Panel container that defines the login form.--> - <mx:Panel title="Login" title.register="Register" id="loginPanel" - horizontalScrollPolicy="off" verticalScrollPolicy="off" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Text width="100%" color="blue" - text="Click the 'Need to Register?' link to change state. Click the 'Return to Login' link to return to the base state."/> - - <mx:Form id="loginForm"> - <mx:FormItem label="Username:"> - <mx:TextInput/> - </mx:FormItem> - <mx:FormItem label="Password:"> - <mx:TextInput/> - </mx:FormItem> - <mx:FormItem id="confirm" label="Confirm:" includeIn="register"> - <mx:TextInput/> - </mx:FormItem> - </mx:Form> - <mx:ControlBar> - <mx:LinkButton id="registerLink" label="Need to Register?" - click="currentState='register'" excludeFrom="register"/> - <mx:LinkButton id="loginLink" label="Return to Login" click="currentState='default'" - includeIn="register" /> - <mx:Spacer width="100%" id="spacer1"/> - <mx:Button label="Login" label.register="register" color.register="blue" id="loginButton" /> - </mx:ControlBar> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/CreditCardValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/CreditCardValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/CreditCardValidatorExample.mxml deleted file mode 100755 index c541e43..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/CreditCardValidatorExample.mxml +++ /dev/null @@ -1,68 +0,0 @@ -<?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 CreditCardValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <!-- Define model for the credit card data. --> - <fx:Model id="creditcard"> - <card> - <cardType>{cardTypeCombo.selectedItem.data}</cardType> - <cardNumber>{cardNumberInput.text}</cardNumber> - </card> - </fx:Model> - - <mx:CreditCardValidator id="ccV" - cardTypeSource="{creditcard}" cardTypeProperty="cardType" - cardNumberSource="{creditcard}" cardNumberProperty="cardNumber" - trigger="{myButton}" triggerEvent="click" - cardTypeListener="{cardTypeCombo}" - cardNumberListener="{cardNumberInput}" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="CreditCardValidator Example" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form id="creditCardForm"> - <mx:FormItem label="Card Type"> - <mx:ComboBox id="cardTypeCombo"> - <mx:dataProvider> - <fx:Object label="American Express" data="American Express"/> - <fx:Object label="Diners Club" data="Diners Club"/> - <fx:Object label="Discover" data="Discover"/> - <fx:Object label="MasterCard" data="MasterCard"/> - <fx:Object label="Visa" data="Visa"/> - </mx:dataProvider> - </mx:ComboBox> - </mx:FormItem> - <mx:FormItem label="Credit Card Number"> - <mx:TextInput id="cardNumberInput"/> - </mx:FormItem> - <mx:FormItem> - <mx:Button id="myButton" label="Check Credit"/> - </mx:FormItem> - </mx:Form> - - </mx:Panel> -</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/CurrencyValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/CurrencyValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/CurrencyValidatorExample.mxml deleted file mode 100755 index 704d05c..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/CurrencyValidatorExample.mxml +++ /dev/null @@ -1,45 +0,0 @@ -<?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 CurrencyValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <mx:CurrencyValidator source="{priceUS}" property="text" precision="2" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="CurrencyValidator Example" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter a U.S. dollar amount: "> - <mx:TextInput id="priceUS" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate"/> - </mx:FormItem> - </mx:Form> - </mx:Panel> -</mx:Application> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/DateValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/DateValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/DateValidatorExample.mxml deleted file mode 100755 index f6526ab..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/DateValidatorExample.mxml +++ /dev/null @@ -1,52 +0,0 @@ -<?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 DateValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <fx:Model id="CheckModel"> - <dateInfo> - <DOB>{dob.text}</DOB> - </dateInfo> - </fx:Model> - - <mx:DateValidator source="{dob}" property="text" allowedFormatChars="/" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="DateValidator Example" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter date of birth (mm/dd/yyyy): "> - <mx:TextInput id="dob" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate" /> - </mx:FormItem> - </mx:Form> - - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/EmailValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/EmailValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/EmailValidatorExample.mxml deleted file mode 100755 index bd1d3cb..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/EmailValidatorExample.mxml +++ /dev/null @@ -1,45 +0,0 @@ -<?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 EmailValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <mx:EmailValidator source="{email}" property="text" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="EmailValidator Example" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter an e-mail address: "> - <mx:TextInput id="email" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate" /> - </mx:FormItem> - </mx:Form> - </mx:Panel> - </mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/NumberValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/NumberValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/NumberValidatorExample.mxml deleted file mode 100755 index 4e6303f..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/NumberValidatorExample.mxml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 NumberValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <mx:NumberValidator source="{age}" property="text" integerError="Enter Integer value" - minValue="18" maxValue="50" domain="int" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="NumberValidator Example" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter an age between 18 and 50: "> - <mx:TextInput id="age" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate" /> - </mx:FormItem> - </mx:Form> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/PhoneNumberValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/PhoneNumberValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/PhoneNumberValidatorExample.mxml deleted file mode 100755 index 100607a..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/PhoneNumberValidatorExample.mxml +++ /dev/null @@ -1,45 +0,0 @@ -<?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 PhoneNumberValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <mx:PhoneNumberValidator source="{phone}" property="text" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="Phone Number Validator Panel" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter 10-digit phone number: "> - <mx:TextInput id="phone" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate" /> - </mx:FormItem> - </mx:Form> - </mx:Panel> -</mx:Application> \ No newline at end of file