|
|
systemFonts.mxml <?xml version=”1.0″ encoding=”utf-8″?> |
|
|
systemFonts.mxml <?xml version=”1.0″ encoding=”utf-8″?> |
Posted by Jon at 10:07 AM
Labels: Flex, Flex Examples, Flex Prainting
|
|
| formPrint .mxml |
<?xml version="1.0" encoding="utf-8"?> [Bindable] [Bindable] [Bindable] public var formPrintView:FormPrintView; public function srvResult(event : ResultEvent):void for (var i : int = 1 ; i < 100 ; i++) ArrayCollection(myDataGrid.dataProvider).addItem(product); prodTotal += product.totalPrice; } public function doPrintForm():void var numRows:uint = myDataGrid.dataProvider ? myDataGrid.dataProvider.length : 0; var headerShift:int = formPrintView.myDataGrid.showHeaders ? 1 : 0; if((formPrintView.myDataGrid.verticalScrollPosition + (formPrintView.myDataGrid.rowCount - headerShift)) >= numRows) formPrintView.pageNumber++; if((formPrintView.myDataGrid.verticalScrollPosition + (formPrintView.myDataGrid.rowCount - headerShift)) >= numRows) pj.addObject(formPrintView); } <mx:HTTPService id="srv" url="../assets/catalog.xml" useProxy="false" result="srvResult(event)"/> <mx:TabNavigator width="100%" creationPolicy="all"> <mx:DataGrid id="myDataGrid" width="100%" > <FormPrintFooter id="footer" prodTotal="{prodTotal}"/> <mx:HBox> |
| formPrintView .mxml |
| <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" backgroundColor="#FFFFFF" paddingTop="10" paddingLeft="15" paddingRight="15" paddingBottom="15"> <mx:Script> <![CDATA[ import mx.core.*; [Bindable] [Bindable] public var headerHeight:Number = 0 [Bindable] public function showPage(pageType:String):void if (pageType == "last" pageType == "single") myDataGrid.percentHeight = 100; ]]> <mx:HBox width="100%" paddingLeft="10" paddingRight="10"> <FormPrintHeader id="header" order="{order}" /> <mx:PrintDataGrid id="myDataGrid" width="100%" > <FormPrintFooter id="footer" prodTotal="{prodTotal}"/> <mx:HRule width="100%"/> <mx:VBox width="100%" horizontalAlign="right"> <mx:Label text="Thank you for your order!" fontSize="16" fontStyle="italic" fontFamily="times" color="0xffAA00"/> </mx:VBox> |
| formPrintFooter .mxml |
| <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" percentWidth="100" horizontalAlign="right" > <mx:Script> <![CDATA[ [Bindable] public var prodTotal:Number = 0; ]]> </mx:Script> <mx:NumberFormatter id="price" precision="2" rounding="none" decimalSeparatorTo="." thousandsSeparatorTo="," useThousandsSeparator="true" useNegativeSign="true"/> <mx:Label text="Total: ${price.format(prodTotal)}" fontWeight="bold"/> </mx:VBox> |
| formPrintHeader .mxml |
| <?xml version="1.0" encoding="utf-8"?> <mx:Form xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:Script> <![CDATA[ [Bindable] public var order:Object; ]]> </mx:Script> <mx:VBox > |
Posted by Jon at 9:47 AM
Labels: Flex Prainting