home *** CD-ROM | disk | FTP | other *** search
- package com.livebrush.ui
- {
- public class Dialog extends UIModel
- {
- public static var NOTICE:String = "notice";
-
- public static var LOADING:String = "loading";
-
- public static var QUESTION:String = "question";
-
- public static var DELAY:String = "delay";
-
- public static var PROCESS:String = "process";
-
- public var type:String;
-
- public var id:String = "";
-
- public var ui:UI;
-
- public var data:Object;
-
- public var dialogView:DialogView;
-
- public var noFunction:Function;
-
- public var thisScope:Object;
-
- public var yesFunction:Function;
-
- public function Dialog(type:String, data:Object = null)
- {
- super();
- this.ui = UI.MAIN_UI;
- this.type = type;
- this.data = data;
- this.yesFunction = data.yesFunction;
- this.noFunction = data.noFunction;
- this.id = data.id != null ? data.id : "";
- this.thisScope = data.thisScope != null ? data.thisScope : this;
- this.init();
- }
-
- public function yesAction() : void
- {
- this.close();
- try
- {
- if(this.data.yesProps != null)
- {
- this.yesFunction.apply(this.thisScope,this.data.yesProps);
- }
- else
- {
- this.yesFunction();
- }
- }
- catch(e:Error)
- {
- }
- }
-
- private function init() : void
- {
- this.dialogView = DialogView(registerView(new DialogView(this)));
- }
-
- public function noAction() : void
- {
- this.close();
- try
- {
- if(this.data.noProps != null)
- {
- this.noFunction.apply(this.thisScope,this.data.noProps);
- }
- else
- {
- this.noFunction();
- }
- }
- catch(e:Error)
- {
- }
- }
-
- public function close() : void
- {
- this.ui.closeDialog(this);
- }
- }
- }
-
-