home *** CD-ROM | disk | FTP | other *** search
- package com.livebrush.ui
- {
- import com.livebrush.graphics.canvas.Canvas;
- import com.livebrush.utils.Update;
-
- public class NewProjectView extends UIView
- {
- public var data:Object;
-
- public var panelAsset:WindowAssetUI;
-
- public var enableDrag:Boolean = true;
-
- public var uiAsset:NewProjectUI;
-
- public function NewProjectView(ui:UI, data:Object = null)
- {
- super(ui);
- helpID = "newProject";
- this.data = data;
- init();
- }
-
- override public function die() : void
- {
- this.newProjectController.die();
- UI.WINDOW_HOLDER.removeChild(this.panelAsset);
- this.panelAsset.removeChild(this.uiAsset);
- this.panelAsset = null;
- this.uiAsset = null;
- }
-
- override protected function createView() : void
- {
- var sizeObj:Object = null;
- this.panelAsset = new WindowAssetUI();
- this.panelAsset.cacheAsBitmap = true;
- this.panelAsset.titleBtn.useHandCursor = false;
- this.uiAsset = new NewProjectUI();
- this.panelAsset.bg.width = 420;
- this.panelAsset.bg.height = 150;
- this.panelAsset.title.text = "Start A New Livebrush Project";
- this.panelAsset.helpBtn.visible = this.panelAsset.helpBtn.enabled = false;
- this.panelAsset.toggleBtn.visible = this.panelAsset.toggleBtn.enabled = false;
- this.enableDrag = true;
- this.uiAsset.sizeList.rowCount = 10;
- for(var i:int = 0; i < Canvas.sizeRes.length; i++)
- {
- sizeObj = Canvas.sizeRes[i][0];
- this.uiAsset.sizeList.addItem({
- "label":sizeObj.x + " x " + sizeObj.y + (sizeObj.label != "" ? " - " + sizeObj.label : ""),
- "data":i
- });
- }
- this.uiAsset.sizeList.selectedIndex = 2;
- this.uiAsset.x = 17;
- this.uiAsset.y = 38;
- this.uiAsset.cacheAsBitmap = true;
- this.panelAsset.addChild(this.uiAsset);
- this.panelAsset.x = UI.centerX - this.panelAsset.width / 2;
- this.panelAsset.y = UI.centerY - this.panelAsset.height / 2;
- UI.WINDOW_HOLDER.addChild(this.panelAsset);
- }
-
- override protected function createController() : void
- {
- controller = new NewProjectController(this);
- }
-
- override public function update(update:Update = null) : void
- {
- }
-
- public function get newProjectController() : NewProjectController
- {
- return NewProjectController(controller);
- }
- }
- }
-
-