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 / Consol.as < prev    next >
Encoding:
Text File  |  2009-10-26  |  4.3 KB  |  170 lines

  1. package com.livebrush.ui
  2. {
  3.    import fl.controls.Button;
  4.    import fl.controls.TextArea;
  5.    import flash.display.MovieClip;
  6.    import flash.events.MouseEvent;
  7.    
  8.    [Embed(source="/_assets/assets.swf", symbol="symbol261")]
  9.    public class Consol extends Panel
  10.    {
  11.       public static var recentConsol:Consol;
  12.       
  13.       public static var globalConsol:Consol;
  14.       
  15.       public static var messageTypes:Array = [{
  16.          "id":"default",
  17.          "color":0,
  18.          "indent":0,
  19.          "prefix":"",
  20.          "suffix":"",
  21.          "newline":true,
  22.          "bold":false
  23.       },{
  24.          "id":"warning",
  25.          "color":14483456,
  26.          "indent":0,
  27.          "prefix":"",
  28.          "suffix":"",
  29.          "newline":true,
  30.          "bold":false
  31.       },{
  32.          "id":"app",
  33.          "color":0,
  34.          "indent":0,
  35.          "prefix":"",
  36.          "suffix":"",
  37.          "newline":true,
  38.          "bold":true
  39.       },{
  40.          "id":"file",
  41.          "color":56576,
  42.          "indent":2,
  43.          "prefix":"",
  44.          "suffix":"",
  45.          "newline":true,
  46.          "bold":false
  47.       }];
  48.       
  49.       public var bg:MovieClip;
  50.       
  51.       public var clearBtn:Button;
  52.       
  53.       public var tf:TextArea;
  54.       
  55.       public var titlebar:PanelTitleBar;
  56.       
  57.       public function Consol()
  58.       {
  59.          super();
  60.          super.setup();
  61.          this.titlebar.showHelp = false;
  62.          label = "Consol";
  63.          recentConsol = this;
  64.          this.clearBtn.addEventListener(MouseEvent.CLICK,this.clearConsole);
  65.          this.__setProp_tf_Console_Layer82_0();
  66.          this.__setProp_clearBtn_Console_Layer82_0();
  67.       }
  68.       
  69.       public static function Trace(str:Object, addReplace:Boolean = true) : void
  70.       {
  71.          Consol.globalOutput(str,addReplace);
  72.       }
  73.       
  74.       public static function globalOutput(str:Object, addReplace:Boolean = true) : void
  75.       {
  76.          if(globalConsol == null)
  77.          {
  78.             globalConsol = recentConsol;
  79.          }
  80.          globalConsol.output(str,addReplace);
  81.       }
  82.       
  83.       public static function Clear() : void
  84.       {
  85.          Consol.globalConsol.tf.text = "";
  86.       }
  87.       
  88.       public function output(str:Object, addReplace:Boolean = true) : void
  89.       {
  90.          try
  91.          {
  92.             if(addReplace)
  93.             {
  94.                this.tf.text += str.toString() + "\n";
  95.             }
  96.             else
  97.             {
  98.                this.tf.text = str.toString();
  99.             }
  100.          }
  101.          catch(e:Error)
  102.          {
  103.             output("Consol: Object passed to Consol is null or undefined -> " + e.toString());
  104.          }
  105.          this.tf.verticalScrollPosition = this.tf.maxVerticalScrollPosition;
  106.          recentConsol = this;
  107.       }
  108.       
  109.       internal function __setProp_tf_Console_Layer82_0() : *
  110.       {
  111.          try
  112.          {
  113.             this.tf["componentInspectorSetting"] = true;
  114.          }
  115.          catch(e:Error)
  116.          {
  117.          }
  118.          this.tf.condenseWhite = false;
  119.          this.tf.editable = true;
  120.          this.tf.enabled = true;
  121.          this.tf.horizontalScrollPolicy = "auto";
  122.          this.tf.htmlText = "";
  123.          this.tf.maxChars = 0;
  124.          this.tf.restrict = "";
  125.          this.tf.text = "";
  126.          this.tf.verticalScrollPolicy = "auto";
  127.          this.tf.visible = true;
  128.          this.tf.wordWrap = false;
  129.          try
  130.          {
  131.             this.tf["componentInspectorSetting"] = false;
  132.          }
  133.          catch(e:Error)
  134.          {
  135.          }
  136.       }
  137.       
  138.       public function clearConsole(e:MouseEvent = null) : void
  139.       {
  140.          Consol.Clear();
  141.       }
  142.       
  143.       internal function __setProp_clearBtn_Console_Layer82_0() : *
  144.       {
  145.          try
  146.          {
  147.             this.clearBtn["componentInspectorSetting"] = true;
  148.          }
  149.          catch(e:Error)
  150.          {
  151.          }
  152.          this.clearBtn.emphasized = false;
  153.          this.clearBtn.enabled = true;
  154.          this.clearBtn.label = "Clear";
  155.          this.clearBtn.labelPlacement = "right";
  156.          this.clearBtn.selected = false;
  157.          this.clearBtn.toggle = false;
  158.          this.clearBtn.visible = true;
  159.          try
  160.          {
  161.             this.clearBtn["componentInspectorSetting"] = false;
  162.          }
  163.          catch(e:Error)
  164.          {
  165.          }
  166.       }
  167.    }
  168. }
  169.  
  170.