#initclip 1 function FRadioButtonClass() { this.init(); } FRadioButtonClass.prototype = new FUIComponentClass(); FRadioButtonGroupClass.prototype = new FUIComponentClass(); Object.registerClass("FRadioButtonSymbol", FRadioButtonClass); FRadioButtonClass.prototype.init = function() { if ( this.initialState == undefined ) { this.selected = false; } else { this.selected = this.initialState; } super.setSize(this._width,this._height); this.boundingBox_mc.unloadMovie(); this.boundingBox_mc._width = 0; this.boundingBox_mc._height = 0; this.attachMovie("frb_hitArea","frb_hitArea_mc",1); this.attachMovie("frb_states","frb_states_mc",2); this.attachMovie("FLabelSymbol","fLabel_mc",3); super.init(); this._xscale = 100; this._yscale = 100; this.setSize(this.width,this.height); this.setChangeHandler(this.changeHandler); if(this.label!=undefined){ this.setLabel(this.label); } if ( this.initialState == undefined ) { this.setValue(false); } else { this.setValue(this.initialState); } if ( this.data == "" ) { this.data = undefined; } else { this.setData(this.data); } this.addToRadioGroup(); // ACCESSIBILITY DEFINED :: _accImpl object defined in base class this.ROLE_SYSTEM_RADIOBUTTON = 0x2d; this.STATE_SYSTEM_SELECTED = 0x10; this.EVENT_OBJECT_STATECHANGE = 0x800a; this.EVENT_OBJECT_NAMECHANGE = 0x800c; this._accImpl.master = this; this._accImpl.stub = false; this._accImpl.get_accRole = this.get_accRole; this._accImpl.get_accName = this.get_accName; this._accImpl.get_accState = this.get_accState; this._accImpl.get_accDefaultAction = this.get_accDefaultAction; this._accImpl.accDoDefaultAction = this.accDoDefaultAction; } FRadioButtonClass.prototype.setHitArea = function(w,h) { var hit = this.frb_hitArea_mc; this.hitArea = hit; if ( this.frb_states_mc._width > w ){ hit._width = this.frb_states_mc._width; }else{ hit._width = w; } hit._visible = false; if (arguments.length > 1){ hit._height = h; } } FRadioButtonClass.prototype.txtFormat = function( pos ) { var txtS = this.textStyle; var sTbl = this.styleTable; txtS.align = (sTbl.textAlign.value == undefined) ? txtS.align = pos : undefined; txtS.leftMargin = (sTbl.textLeftMargin.value == undefined) ? txtS.leftMargin = 0 : undefined; txtS.rightMargin = (sTbl.textRightMargin.value == undefined) ? txtS.rightMargin = 0 : undefined if(this.fLabel_mc._height > (this.height / 2)){ super.setSize(this.width,this.fLabel_mc._height); //accomodate radiobutton height size this.frb_states_mc._height = this.fLabel_mc._height/2; this.frb_states_mc._width = this.fLabel_mc._height/2; }else{ super.setSize(this.width,this.height); } this.setEnabled(this.enable); } //:::::: FRadioButtonClass :::::: FRadioButtonClass.prototype.setSize = function(w,h) { this.setLabel(this.getLabel()); this.setLabelPlacement(this.labelPlacement); if(this.frb_states_mc._height < this.fLabel_mc.labelField._height){ super.setSize(w,this.fLabel_mc.labelField._height); } this.setHitArea(this.width,this.height); this.setLabelPlacement(this.labelPlacement); } FRadioButtonClass.prototype.setLabelPlacement = function( pos ) { this.setLabel(this.getLabel()); this.txtFormat( pos ); var halfLabelH = this.fLabel_mc._height/2; var halfFrameH = (this.frb_states_mc._height-1)/2; var vertCenter = (halfFrameH - halfLabelH ); var radioWidth = this.frb_states_mc._width; var frame = this.frb_states_mc var label = this.fLabel_mc; var w = this.width - frame._width; if (frame._width > this.width){ w = 0; } else { w = this.width - frame._width; } this.fLabel_mc.setSize(w); if (pos == "right" || pos == undefined){ this.labelPlacement = "right"; this.frb_states_mc._x = 0; this.fLabel_mc._x = radioWidth + 2; this.txtFormat("left"); } else if (pos == "left"){ this.labelPlacement = "left"; this.fLabel_mc._x = 0; this.frb_states_mc._x = this.width - radioWidth + 2; this.txtFormat("right"); } this.fLabel_mc._y = vertCenter ; this.frb_hitArea_mc._y = vertCenter; this.setLabel(this.getLabel()); } FRadioButtonClass.prototype.setData = function( dataValue ) { this.data = dataValue; } FRadioButtonClass.prototype.getData = function() { return this.data; } FRadioButtonClass.prototype.getState = function() { return this.selected; } FRadioButtonClass.prototype.getSize = function() { return this.width; } FRadioButtonClass.prototype.getGroupName = function() { return this.groupName; } FRadioButtonClass.prototype.setGroupName = function( groupName ) { for (var i=0; i= widestRadio){ widestRadio = this.radioInstances[i].width; } } return(widestRadio); } FRadioButtonGroupClass.prototype.setGroupName = function( groupName ) { this.oldGroupName = this.radioInstances[0].groupName; for (var i=0; i=0;i--){ var inc = (i-1); if (this._parent[this.groupName].radioInstances[inc].getEnabled()){ this._parent[this.groupName].radioInstances[inc].setTabState(true) return; } } } } // START ACCESSIBILITY FRadioButtonClass.prototype.get_accRole = function(childId) { return this.master.ROLE_SYSTEM_RADIOBUTTON; } FRadioButtonClass.prototype.get_accName = function(childId) { return this.master.getLabel(); } FRadioButtonClass.prototype.get_accState = function(childId) { if ( this.master.getState()){ return this.master.STATE_SYSTEM_SELECTED; }else{ return 0; } } FRadioButtonClass.prototype.get_accDefaultAction = function(childId) { if (this.master.getState()){ return "UnCheck"; }else{ return "Check"; } } FRadioButtonClass.prototype.accDoDefaultAction = function(childId) { this.master.setValue( !this.master.getValue() ); } // END ACCESSIBILITY #endinitclip boundingBox_mc._visible = false; deadPreview._visible = false;