home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Utils / Livebrush / Install-LivebrushLite.air / livebrush.swf / scripts / com / livebrush / ui / NewProjectView.as < prev    next >
Encoding:
Text File  |  2009-10-26  |  2.6 KB  |  81 lines

  1. package com.livebrush.ui
  2. {
  3.    import com.livebrush.graphics.canvas.Canvas;
  4.    import com.livebrush.utils.Update;
  5.    
  6.    public class NewProjectView extends UIView
  7.    {
  8.       public var data:Object;
  9.       
  10.       public var panelAsset:WindowAssetUI;
  11.       
  12.       public var enableDrag:Boolean = true;
  13.       
  14.       public var uiAsset:NewProjectUI;
  15.       
  16.       public function NewProjectView(ui:UI, data:Object = null)
  17.       {
  18.          super(ui);
  19.          helpID = "newProject";
  20.          this.data = data;
  21.          init();
  22.       }
  23.       
  24.       override public function die() : void
  25.       {
  26.          this.newProjectController.die();
  27.          UI.WINDOW_HOLDER.removeChild(this.panelAsset);
  28.          this.panelAsset.removeChild(this.uiAsset);
  29.          this.panelAsset = null;
  30.          this.uiAsset = null;
  31.       }
  32.       
  33.       override protected function createView() : void
  34.       {
  35.          var sizeObj:Object = null;
  36.          this.panelAsset = new WindowAssetUI();
  37.          this.panelAsset.cacheAsBitmap = true;
  38.          this.panelAsset.titleBtn.useHandCursor = false;
  39.          this.uiAsset = new NewProjectUI();
  40.          this.panelAsset.bg.width = 420;
  41.          this.panelAsset.bg.height = 150;
  42.          this.panelAsset.title.text = "Start A New Livebrush Project";
  43.          this.panelAsset.helpBtn.visible = this.panelAsset.helpBtn.enabled = false;
  44.          this.panelAsset.toggleBtn.visible = this.panelAsset.toggleBtn.enabled = false;
  45.          this.enableDrag = true;
  46.          this.uiAsset.sizeList.rowCount = 10;
  47.          for(var i:int = 0; i < Canvas.sizeRes.length; i++)
  48.          {
  49.             sizeObj = Canvas.sizeRes[i][0];
  50.             this.uiAsset.sizeList.addItem({
  51.                "label":sizeObj.x + " x " + sizeObj.y + (sizeObj.label != "" ? " - " + sizeObj.label : ""),
  52.                "data":i
  53.             });
  54.          }
  55.          this.uiAsset.sizeList.selectedIndex = 2;
  56.          this.uiAsset.x = 17;
  57.          this.uiAsset.y = 38;
  58.          this.uiAsset.cacheAsBitmap = true;
  59.          this.panelAsset.addChild(this.uiAsset);
  60.          this.panelAsset.x = UI.centerX - this.panelAsset.width / 2;
  61.          this.panelAsset.y = UI.centerY - this.panelAsset.height / 2;
  62.          UI.WINDOW_HOLDER.addChild(this.panelAsset);
  63.       }
  64.       
  65.       override protected function createController() : void
  66.       {
  67.          controller = new NewProjectController(this);
  68.       }
  69.       
  70.       override public function update(update:Update = null) : void
  71.       {
  72.       }
  73.       
  74.       public function get newProjectController() : NewProjectController
  75.       {
  76.          return NewProjectController(controller);
  77.       }
  78.    }
  79. }
  80.  
  81.