1 /* ************************************************************************
3 qooxdoo - the new era of web development
8 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
11 LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
14 * Sebastian Werner (wpbasti)
15 * Andreas Ecker (ecker)
17 ************************************************************************ */
19 /* ************************************************************************
23 ************************************************************************ */
25 qx.OO.defineClass("qx.ui.toolbar.RadioButton", qx.ui.toolbar.CheckBox,
26 function(vText, vIcon, vChecked) {
27 qx.ui.toolbar.CheckBox.call(this, vText, vIcon, vChecked);
34 ---------------------------------------------------------------------------
36 ---------------------------------------------------------------------------
40 The assigned qx.manager.selection.RadioManager which handles the switching between registered buttons
42 qx.OO.addProperty({ name : "manager", type : "object", instance : "qx.manager.selection.RadioManager", allowNull : true });
45 The name of the radio group. All the radio elements in a group (registered by the same manager)
46 have the same name (and could have a different value).
48 qx.OO.addProperty({ name : "name", type : "string" });
51 Prohibit the deselction of the checked radio button when clicked on it.
53 qx.OO.addProperty({ name : "disableUncheck", type : "boolean", defaultValue : false });
61 ---------------------------------------------------------------------------
63 ---------------------------------------------------------------------------
66 qx.Proto._modifyChecked = function(propValue, propOldValue, propData)
68 qx.ui.toolbar.CheckBox.prototype._modifyChecked.call(this, propValue, propOldValue, propData);
70 var vManager = this.getManager();
72 vManager.handleItemChecked(this, propValue);
78 qx.Proto._modifyManager = function(propValue, propOldValue, propData)
81 propOldValue.remove(this);
96 ---------------------------------------------------------------------------
98 ---------------------------------------------------------------------------
101 qx.Proto._onmouseup = function(e)
103 this.setCapture(false);
105 if (!this.hasState("abandoned"))
107 this.addState("over");
108 this.setChecked(this.getDisableUncheck() || !this.getChecked());
112 this.removeState("abandoned");
113 this.removeState("pressed");