home *** CD-ROM | disk | FTP | other *** search
- package com.livebrush.ui
- {
- import com.livebrush.events.UpdateEvent;
- import com.livebrush.utils.Update;
- import flash.text.TextField;
-
- public class BasicWindowView extends UIView
- {
- public var data:Object;
-
- public var panelAsset:WindowAssetUI;
-
- public var enableDrag:Boolean = true;
-
- public var uiAsset:BasicWindowUI;
-
- public function BasicWindowView(ui:UI, data:Object = null)
- {
- super(ui);
- this.data = data;
- init();
- }
-
- override public function die() : void
- {
- this.basicWindowController.die();
- UI.WINDOW_HOLDER.removeChild(this.panelAsset);
- this.panelAsset.removeChild(this.uiAsset);
- this.panelAsset = null;
- this.uiAsset = null;
- }
-
- override protected function createView() : void
- {
- this.panelAsset = new WindowAssetUI();
- this.panelAsset.cacheAsBitmap = true;
- this.panelAsset.titleBtn.useHandCursor = false;
- this.uiAsset = new BasicWindowUI();
- this.panelAsset.bg.width = 420;
- this.panelAsset.bg.height = 250;
- this.panelAsset.title.text = "";
- this.panelAsset.helpBtn.visible = this.panelAsset.helpBtn.enabled = false;
- this.panelAsset.toggleBtn.visible = this.panelAsset.toggleBtn.enabled = false;
- this.enableDrag = true;
- 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);
- this.update(Update.dataUpdate(this.data));
- }
-
- public function get messageField() : TextField
- {
- return this.uiAsset["message"];
- }
-
- override protected function createController() : void
- {
- controller = new BasicWindowController(this);
- }
-
- override public function update(update:Update = null) : void
- {
- try
- {
- if(update.type == UpdateEvent.DATA)
- {
- this.message = update.data.message;
- }
- }
- catch(e:Error)
- {
- }
- }
-
- public function set message(s:String) : void
- {
- this.messageField.htmlText = s;
- }
-
- public function get basicWindowController() : BasicWindowController
- {
- return BasicWindowController(controller);
- }
- }
- }
-
-