home *** CD-ROM | disk | FTP | other *** search
- FMultiTextComponentClass = function()
- {
- if(this.hostComponent == undefined)
- {
- this.hostComponent = this._parent.controller != undefined ? this._parent.controller : this._parent;
- }
- if(this.hostComponent.textStyle == undefined)
- {
- this.hostComponent.textStyle = new TextFormat();
- }
- this.textStyle = this.hostComponent.textStyle;
- this.enable = true;
- this.registerTextElement = FMultiTextComponentClass.prototype.registerTextElement;
- this.setCustomStyleProperty = FMultiTextComponentClass.prototype.setCustomStyleProperty;
- };
- FMultiTextComponentClass.prototype.registerTextElement = function(fLabelInstance, propertyName)
- {
- if(this.textFormatTable == undefined)
- {
- this.textFormatTable = new Object();
- }
- this.textFormatTable[propertyName] = true;
- if(this.styleTable == undefined)
- {
- this.styleTable = new Object();
- }
- if(this.styleTable[propertyName] == undefined)
- {
- this.styleTable[propertyName] = new Object();
- this.styleTable[propertyName].useGlobal = true;
- }
- if(this.styleTable[propertyName].textInstances == undefined)
- {
- this.styleTable[propertyName].textInstances = new Object();
- }
- this.styleTable[propertyName].textInstances[fLabelInstance] = fLabelInstance;
- if(fLabelInstance.prototype.setEnabledFixed == undefined)
- {
- fLabelInstance.setEnabled = FMultiTextComponentClass.prototype.setEnabledFixed;
- }
- if(this.styleTable[propertyName].value != undefined)
- {
- fLabelInstance.textStyle = this.styleTable[propertyName].value;
- fLabelInstance.setLabel(fLabelInstance.getLabel());
- }
- };
- FMultiTextComponentClass.prototype.setCustomStyleProperty = function(propertyName, value)
- {
- if(!this.textFormatTable[propertyName])
- {
- return false;
- }
- this.invalidate("setSize");
- for(var fLabelInstance in this.styleTable[propertyName].textInstances)
- {
- var cl = this.styleTable[propertyName].textInstances[fLabelInstance];
- cl.textStyle = value;
- cl.labelField.embedFonts = this.styleTable.embedFonts == undefined ? false : this.styleTable.embedFonts.value;
- cl.setLabel(cl.getLabel());
- }
- return true;
- };
- FMultiTextComponentClass.prototype.setEnabledFixed = function(enable)
- {
- this.enable = enable;
- var tmpColor = !enable ? this.hostComponent.styleTable.textDisabled.value : this.textStyle.color;
- if(tmpColor == undefined)
- {
- tmpColor = !enable ? 8947848 : 0;
- }
- this.setColor(tmpColor);
- };
-