home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Swf / Produtividade.swf / scripts / __Packages / mx / controls / Label.as < prev    next >
Encoding:
Text File  |  2010-02-24  |  4.4 KB  |  192 lines

  1. class mx.controls.Label extends mx.core.UIObject
  2. {
  3.    var labelField;
  4.    var _color;
  5.    var initText;
  6.    var __autoSize;
  7.    var __width;
  8.    var __height;
  9.    static var symbolName = "Label";
  10.    static var symbolOwner = Object(mx.controls.Label);
  11.    var className = "Label";
  12.    static var version = "2.0.0.377";
  13.    var initializing = true;
  14.    var clipParameters = {text:1,html:1,autoSize:1};
  15.    static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.Label.prototype.clipParameters,mx.core.UIObject.prototype.clipParameters);
  16.    function Label()
  17.    {
  18.       super();
  19.    }
  20.    function init(Void)
  21.    {
  22.       super.init();
  23.       this._xscale = this._yscale = 100;
  24.       this.labelField.selectable = false;
  25.       this.labelField.styleName = this;
  26.       this.tabEnabled = false;
  27.       this.tabChildren = false;
  28.       this.useHandCursor = false;
  29.       this._color = mx.core.UIObject.textColorList;
  30.    }
  31.    function get html()
  32.    {
  33.       return this.getHtml();
  34.    }
  35.    function set html(value)
  36.    {
  37.       this.setHtml(value);
  38.    }
  39.    function getHtml()
  40.    {
  41.       return this.labelField.html;
  42.    }
  43.    function setHtml(value)
  44.    {
  45.       if(value != this.labelField.html)
  46.       {
  47.          this.labelField.html = value;
  48.       }
  49.    }
  50.    function get text()
  51.    {
  52.       return this.getText();
  53.    }
  54.    function set text(t)
  55.    {
  56.       this.setText(t);
  57.    }
  58.    function getText()
  59.    {
  60.       if(this.initializing)
  61.       {
  62.          return this.initText;
  63.       }
  64.       var _loc2_ = this.labelField;
  65.       if(_loc2_.html == true)
  66.       {
  67.          return _loc2_.htmlText;
  68.       }
  69.       return _loc2_.text;
  70.    }
  71.    function setText(t)
  72.    {
  73.       if(this.initializing)
  74.       {
  75.          this.initText = t;
  76.       }
  77.       else
  78.       {
  79.          var _loc2_ = this.labelField;
  80.          if(_loc2_.html == true)
  81.          {
  82.             _loc2_.htmlText = t;
  83.          }
  84.          else
  85.          {
  86.             _loc2_.text = t;
  87.          }
  88.          this.adjustForAutoSize();
  89.       }
  90.    }
  91.    function get autoSize()
  92.    {
  93.       return this.__autoSize;
  94.    }
  95.    function set autoSize(v)
  96.    {
  97.       if(_global.isLivePreview == true)
  98.       {
  99.          v = "none";
  100.       }
  101.       this.__autoSize = v;
  102.       if(!this.initializing)
  103.       {
  104.          this.draw();
  105.       }
  106.    }
  107.    function draw(Void)
  108.    {
  109.       var _loc2_ = this.labelField;
  110.       if(this.initializing)
  111.       {
  112.          var _loc4_ = this.text;
  113.          this.initializing = false;
  114.          this.setText(_loc4_);
  115.          delete this.initText;
  116.       }
  117.       if(_loc2_.html)
  118.       {
  119.          _loc4_ = _loc2_.htmlText;
  120.       }
  121.       var _loc3_ = this._getTextFormat();
  122.       _loc2_.embedFonts = _loc3_.embedFonts == true;
  123.       if(_loc3_ != undefined)
  124.       {
  125.          _loc2_.setTextFormat(_loc3_);
  126.          _loc2_.setNewTextFormat(_loc3_);
  127.       }
  128.       if(_loc2_.html)
  129.       {
  130.          _loc2_.htmlText = _loc4_;
  131.       }
  132.       this.adjustForAutoSize();
  133.    }
  134.    function adjustForAutoSize()
  135.    {
  136.       var _loc2_ = this.labelField;
  137.       var _loc3_ = this.__autoSize;
  138.       if(_loc3_ != undefined && _loc3_ != "none")
  139.       {
  140.          _loc2_._height = _loc2_.textHeight + 3;
  141.          var _loc4_ = this.__width;
  142.          this.setSize(_loc2_.textWidth + 4,_loc2_._height);
  143.          if(_loc3_ == "right")
  144.          {
  145.             this._x += _loc4_ - this.__width;
  146.          }
  147.          else if(_loc3_ == "center")
  148.          {
  149.             this._x += (_loc4_ - this.__width) / 2;
  150.          }
  151.          else if(_loc3_ == "left")
  152.          {
  153.             this._x += 0;
  154.          }
  155.       }
  156.       else
  157.       {
  158.          _loc2_._x = 0;
  159.          _loc2_._width = this.__width;
  160.          _loc2_._height = this.__height;
  161.       }
  162.    }
  163.    function size(Void)
  164.    {
  165.       var _loc2_ = this.labelField;
  166.       _loc2_._width = this.__width;
  167.       _loc2_._height = this.__height;
  168.    }
  169.    function setEnabled(enable)
  170.    {
  171.       this.enabled = enable;
  172.       var _loc2_ = this.getStyle(!enable ? "disabledColor" : "color");
  173.       if(_loc2_ == undefined)
  174.       {
  175.          _loc2_ = !enable ? 8947848 : 0;
  176.       }
  177.       this.setColor(_loc2_);
  178.    }
  179.    function setColor(col)
  180.    {
  181.       this.labelField.textColor = col;
  182.    }
  183.    function get styleSheet()
  184.    {
  185.       return this.labelField.styleSheet;
  186.    }
  187.    function set styleSheet(v)
  188.    {
  189.       this.labelField.styleSheet = v;
  190.    }
  191. }
  192.