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 / PanelTitleBar.as < prev    next >
Encoding:
Text File  |  2009-10-26  |  1.5 KB  |  65 lines

  1. package com.livebrush.ui
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.display.Sprite;
  5.    import flash.text.TextField;
  6.    import flash.text.TextFieldAutoSize;
  7.    
  8.    [Embed(source="/_assets/assets.swf", symbol="symbol241")]
  9.    public class PanelTitleBar extends Sprite
  10.    {
  11.       public var closeBtn:CloseButton;
  12.       
  13.       public var bg:MovieClip;
  14.       
  15.       public var label:TextField;
  16.       
  17.       public var helpBtn:HelpButton;
  18.       
  19.       public function PanelTitleBar()
  20.       {
  21.          super();
  22.          this.init();
  23.       }
  24.       
  25.       public function setWidth(w:Number) : void
  26.       {
  27.          this.bg.width = w;
  28.          this.closeBtn.x = this.bg.width - 18;
  29.          this.showHelp = this.helpBtn.visible;
  30.       }
  31.       
  32.       private function init() : void
  33.       {
  34.          this.label.autoSize = TextFieldAutoSize.LEFT;
  35.       }
  36.       
  37.       public function set showHelp(b:Boolean) : void
  38.       {
  39.          this.helpBtn.visible = b;
  40.          if(this.closeBtn.visible)
  41.          {
  42.             this.helpBtn.x = this.closeBtn.x - this.helpBtn.width - 5;
  43.          }
  44.          else
  45.          {
  46.             this.helpBtn.x = this.closeBtn.x;
  47.          }
  48.       }
  49.       
  50.       public function set showClose(b:Boolean) : void
  51.       {
  52.          this.closeBtn.visible = b;
  53.          if(b)
  54.          {
  55.             this.helpBtn.x = this.closeBtn.x - this.helpBtn.width + 5;
  56.          }
  57.          else
  58.          {
  59.             this.helpBtn.x = this.closeBtn.x;
  60.          }
  61.       }
  62.    }
  63. }
  64.  
  65.