home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 October / maximum-cd-2009-10.iso / main.swf / scripts / __Packages / mx / core / ext / UIComponentExtensions.as next >
Encoding:
Text File  |  2009-07-15  |  1.5 KB  |  49 lines

  1. class mx.core.ext.UIComponentExtensions
  2. {
  3.    var tabEnabled;
  4.    var getFocusManager;
  5.    var drawFocus;
  6.    static var bExtended = false;
  7.    static var UIComponentExtended = mx.core.ext.UIComponentExtensions.Extensions();
  8.    static var UIComponentDependency = mx.core.UIComponent;
  9.    static var FocusManagerDependency = mx.managers.FocusManager;
  10.    static var OverlappedWindowsDependency = mx.managers.OverlappedWindows;
  11.    function UIComponentExtensions()
  12.    {
  13.    }
  14.    static function Extensions()
  15.    {
  16.       if(mx.core.ext.UIComponentExtensions.bExtended == true)
  17.       {
  18.          return true;
  19.       }
  20.       mx.core.ext.UIComponentExtensions.bExtended = true;
  21.       TextField.prototype.setFocus = function()
  22.       {
  23.          Selection.setFocus(this);
  24.       };
  25.       TextField.prototype.onSetFocus = function(oldFocus)
  26.       {
  27.          if(this.tabEnabled != false)
  28.          {
  29.             if(this.getFocusManager().bDrawFocus)
  30.             {
  31.                this.drawFocus(true);
  32.             }
  33.          }
  34.       };
  35.       TextField.prototype.onKillFocus = function(oldFocus)
  36.       {
  37.          if(this.tabEnabled != false)
  38.          {
  39.             this.drawFocus(false);
  40.          }
  41.       };
  42.       TextField.prototype.drawFocus = mx.core.UIComponent.prototype.drawFocus;
  43.       TextField.prototype.getFocusManager = mx.core.UIComponent.prototype.getFocusManager;
  44.       mx.managers.OverlappedWindows.enableOverlappedWindows();
  45.       mx.styles.CSSSetStyle.enableRunTimeCSS();
  46.       mx.managers.FocusManager.enableFocusManagement();
  47.    }
  48. }
  49.