home *** CD-ROM | disk | FTP | other *** search
/ Design Spectrum Color Visions / Design Spectrum Color Visions.iso / Data1.cab / PORTER_main.swf / scripts / %3Cdefault package%3E / FMultiTextComponentSymbol.as < prev    next >
Encoding:
Text File  |  2003-11-26  |  2.5 KB  |  73 lines

  1. FMultiTextComponentClass = function()
  2. {
  3.    if(this.hostComponent == undefined)
  4.    {
  5.       this.hostComponent = this._parent.controller != undefined ? this._parent.controller : this._parent;
  6.    }
  7.    if(this.hostComponent.textStyle == undefined)
  8.    {
  9.       this.hostComponent.textStyle = new TextFormat();
  10.    }
  11.    this.textStyle = this.hostComponent.textStyle;
  12.    this.enable = true;
  13.    this.registerTextElement = FMultiTextComponentClass.prototype.registerTextElement;
  14.    this.setCustomStyleProperty = FMultiTextComponentClass.prototype.setCustomStyleProperty;
  15. };
  16. FMultiTextComponentClass.prototype.registerTextElement = function(fLabelInstance, propertyName)
  17. {
  18.    if(this.textFormatTable == undefined)
  19.    {
  20.       this.textFormatTable = new Object();
  21.    }
  22.    this.textFormatTable[propertyName] = true;
  23.    if(this.styleTable == undefined)
  24.    {
  25.       this.styleTable = new Object();
  26.    }
  27.    if(this.styleTable[propertyName] == undefined)
  28.    {
  29.       this.styleTable[propertyName] = new Object();
  30.       this.styleTable[propertyName].useGlobal = true;
  31.    }
  32.    if(this.styleTable[propertyName].textInstances == undefined)
  33.    {
  34.       this.styleTable[propertyName].textInstances = new Object();
  35.    }
  36.    this.styleTable[propertyName].textInstances[fLabelInstance] = fLabelInstance;
  37.    if(fLabelInstance.prototype.setEnabledFixed == undefined)
  38.    {
  39.       fLabelInstance.setEnabled = FMultiTextComponentClass.prototype.setEnabledFixed;
  40.    }
  41.    if(this.styleTable[propertyName].value != undefined)
  42.    {
  43.       fLabelInstance.textStyle = this.styleTable[propertyName].value;
  44.       fLabelInstance.setLabel(fLabelInstance.getLabel());
  45.    }
  46. };
  47. FMultiTextComponentClass.prototype.setCustomStyleProperty = function(propertyName, value)
  48. {
  49.    if(!this.textFormatTable[propertyName])
  50.    {
  51.       return false;
  52.    }
  53.    this.invalidate("setSize");
  54.    for(var fLabelInstance in this.styleTable[propertyName].textInstances)
  55.    {
  56.       var cl = this.styleTable[propertyName].textInstances[fLabelInstance];
  57.       cl.textStyle = value;
  58.       cl.labelField.embedFonts = this.styleTable.embedFonts == undefined ? false : this.styleTable.embedFonts.value;
  59.       cl.setLabel(cl.getLabel());
  60.    }
  61.    return true;
  62. };
  63. FMultiTextComponentClass.prototype.setEnabledFixed = function(enable)
  64. {
  65.    this.enable = enable;
  66.    var tmpColor = !enable ? this.hostComponent.styleTable.textDisabled.value : this.textStyle.color;
  67.    if(tmpColor == undefined)
  68.    {
  69.       tmpColor = !enable ? 8947848 : 0;
  70.    }
  71.    this.setColor(tmpColor);
  72. };
  73.