Changeset 573 for flamingo/trunk/fmc/classes/gui/Print.as
- Timestamp:
- 16-08-10 10:02:40 (21 months ago)
- File:
-
- 1 edited
-
flamingo/trunk/fmc/classes/gui/Print.as (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flamingo/trunk/fmc/classes/gui/Print.as
r536 r573 41 41 * @hierarchy child node of Flamingo or a container component. 42 42 * @attr scales (optional) default: "500000,250000,100000,50000,20000,10000,5000,2000" comma seperated scale list. 43 * @attr defaulttemplate (optional) no default id of the defaultTemplate (is shown in the combobox when print window becomes visible). 43 44 * @example 44 45 <fmc:Window id="printWindow" top="60" left="60" width="585" height="680" visible="false" skin="g" 45 46 canresize="true" canclose="true"> 46 47 <string id="title" en="Print Settings and Preview" nl="Printinstellingen en printvoorbeeld"/> 47 <fmc:Print id="print" width="100%" height="100%" visible="false" borderwidth="0" listento="map" >48 <fmc:Print id="print" width="100%" height="100%" visible="false" borderwidth="0" listento="map" defaulttemplate="printTemplate1"> 48 49 <string id="previewSize" en="Preview at Original Size" nl="Printvoorbeeld op ware grootte"/> 49 50 <string id="toPrinter" en="Send to Printer" nl="Afdrukken"/> … … 99 100 private var availPreviewWidth:Number = 0; 100 101 private var availPreviewHeight:Number = 0; 101 102 function init():Void { 102 private var defaultTemplate : String = null; 103 104 function init():Void { 103 105 map = _global.flamingo.getComponent(listento[0]); 104 106 var componentIDs:Array = getComponents(); … … 133 135 addCheckBox(); 134 136 addPrintButton(); 135 136 templateComboBox.selectedIndex = 0; 137 138 139 } 137 resetTemplateComboBox(); 138 } 139 140 private function resetTemplateComboBox(){ 141 templateComboBox.selectedIndex = 0; 142 setCurrentPrintTemplate(null); 143 if(defaultTemplate != null){ 144 var templates:Array = templateComboBox.getDataProvider(); 145 for (var j:Number = 0; j < templates.length; j++) { 146 if(templates[j].data == _global.flamingo.getComponent(defaultTemplate)){ 147 templateComboBox.selectedIndex = j; 148 setCurrentPrintTemplate(templates[j].data); 149 } 150 } 151 } 152 153 } 140 154 141 155 function setAttribute(name:String, value:String):Void { … … 143 157 scales=value.split(","); 144 158 } 159 else if(name.toLowerCase()=="defaulttemplate"){ 160 defaultTemplate=value; 161 } 162 145 163 } 146 164 … … 148 166 super.setVisible(vis); 149 167 if(printTemplates.length>1){ 150 setCurrentPrintTemplate(null); 151 templateComboBox.selectedIndex = 0; 168 resetTemplateComboBox(); 152 169 } else { 153 170 currentPrintTemplate.setVisible(vis); … … 165 182 166 183 private function addTemplateSelector():Void { 167 var comboBoxContainer:MovieClip = createEmptyMovieClip("m TemplateComboBoxContainer", 9);184 var comboBoxContainer:MovieClip = createEmptyMovieClip("mBoxContainer", 9); 168 185 var initObject:Object = new Object(); 169 186 initObject["_width"] = 200;
Note: See TracChangeset
for help on using the changeset viewer.