Thursday, 23 June 2011

Title Window Direction


<?xml version="1.0" encoding="utf-8"?>
<utils:TitleWindowWpath xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:mapDesign="com.mapDesign.*" xmlns:local="*"
xmlns:mapPAttern="com.mapPAttern.*" xmlns:utils="utils.*"
       layout="vertical" horizontalScrollPolicy="off" verticalScrollPolicy="off"
       width="500" height="500" titleStyleName="titleText" 
      backgroundColor="#ffffff" backgroundAlpha="1" color="#333333" 
       borderAlpha=".9" cornerRadius="0" dropShadowEnabled="true" 
       shadowDistance="3" shadowDirection="left" showCloseButton="true" 
       close="onTitleWindowClose(event)" creationComplete="centerMe()">

    <mx:Script>
        <![CDATA[
            import mx.core.Application;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;
            import mx.printing.*;


            private function onTitleWindowClose(evt:CloseEvent):void
{
            PopUpManager.removePopUp(this);
            }

private function doPrint():void 
{
                var printJob:FlexPrintJob = new FlexPrintJob();

                if (printJob.start() != true)
return;

                printJob.addObject(textCanvas, FlexPrintJobScaleType.SHOW_ALL);
                printJob.send();
}
                
            public function centerMe():void
{
            this.x = ((Application.application.stage.stageWidth)/2) - (this.width/2);
            this.y = ((Application.application.stage.stageHeight)/2) - (this.height/2);
            }
        ]]>
    </mx:Script>


<mx:Canvas id="textCanvas" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" backgroundColor="#ffffff" backgroundAlpha="1">
<mx:TextArea width="95%" height="95%" htmlText="{this.path}" top="40" horizontalCenter="0"/>
</mx:Canvas>

<mx:Button id="print" label="Print Directions" click="doPrint()" bottom="0" right="0"/>


</utils:TitleWindowWpath>

No comments:

Post a Comment