rename swat => swat2, so that we don't conflict with samba3
[kai/samba-autobuild/.git] / swat2 / style / qooxdoo / widgets / widgets / QxRadioButton.js
1 /* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
2 function QxRadioButton(vText,vValue,vName,vChecked,vGroup){QxCheckBox.call(this,vText,vValue,vName,vChecked);if(isValid(vGroup)){this.setGroup(vGroup);};};QxRadioButton.extend(QxCheckBox,"QxRadioButton");QxRadioButton.addProperty({name:"group"});proto._e3Icon=function(){var i=this._f1=new QxInputCheckIcon();i.setType("radio");i.setChecked(this.isChecked());i.setEnabled(this.isEnabled());i.setAnonymous(true);i.setParent(this);};proto._modifyChecked=function(_b1,_b2,_b3,_b4){if(this._f1){this._f1.setChecked(_b1,_b4);};if(this.getGroup()){this.getGroup().setSelected(this,_b4);};return true;};proto._modifyGroup=function(_b1,_b2,_b3,_b4){if(_b2){_b2.remove(this,_b4);};if(_b1){_b1.add(this,_b4);};return true;};proto._modifyName=function(_b1,_b2,_b3,_b4){if(this.isCreated()&&this._f1){this._f1.setName(_b1,_b4);};if(this.getGroup()){this.getGroup().setName(_b1,_b4);};return true;};proto._modifyValue=function(_b1,_b2,_b3,_b4){if(this.isCreated()&&this._f1){this._f1.setValue(_b1,_b4);};return true;};proto._g4=function(e){switch(e.getKeyCode()){case QxKeyEvent.keys.enter:if(!e.getAltKey()){this.setChecked(this._f1?!this._f1.isChecked():!this.isChecked());};break;case QxKeyEvent.keys.left:case QxKeyEvent.keys.up:return this.getGroup()?this.getGroup().selectPrevious(this):true;case QxKeyEvent.keys.right:case QxKeyEvent.keys.down:return this.getGroup()?this.getGroup().selectNext(this):true;};};proto._g3=function(e){this.setChecked(true);};proto.dispose=function(){if(this.getDisposed()){return;};return QxCheckBox.prototype.dispose.call(this);};