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.form.InputCheckSymbol", qx.ui.basic.Terminator,
28 qx.ui.basic.Terminator.call(this);
30 this.setTagName("input");
31 this.setSelectable(false);
33 if (qx.sys.Client.getInstance().isMshtml())
35 // Take control over size of element (mshtml)
39 else if (qx.sys.Client.getInstance().isGecko())
41 // Remove gecko default margin
45 // we need to be sure that the dom protection of this is added
46 this.forceTabIndex(1);
48 this.setChecked(false);
51 qx.OO.addProperty({ name : "name", type : "string", impl : "apply" });
52 qx.OO.addProperty({ name : "value", impl : "apply" });
53 qx.OO.addProperty({ name : "type", impl : "apply" });
54 qx.OO.addProperty({ name : "checked", type : "boolean", impl : "apply", getAlias : "isChecked" });
56 qx.Proto._modifyApply = function(propValue, propOldValue, propData) {
57 return this.setHtmlProperty(propData.name, propValue);
60 qx.Proto.getPreferredBoxWidth = function() {
64 qx.Proto.getPreferredBoxHeight = function() {
68 qx.Proto.getBoxWidth = qx.Proto.getPreferredBoxWidth;
69 qx.Proto.getBoxHeight = qx.Proto.getPreferredBoxHeight;
71 qx.Proto.getInnerWidth = qx.Proto.getPreferredBoxWidth;
72 qx.Proto.getInnerHeight = qx.Proto.getPreferredBoxHeight;
74 if (qx.sys.Client.getInstance().isMshtml())
76 qx.Proto._afterAppear = function()
78 qx.ui.basic.Terminator.prototype._afterAppear.call(this);
80 var vElement = this.getElement();
81 vElement.checked = this.getChecked();
83 if (!this.getEnabled()) {
84 vElement.disabled = true;
89 qx.Proto._modifyEnabled = function(propValue, propOldValue, propData)
91 propValue ? this.removeHtmlAttribute("disabled") : this.setHtmlAttribute("disabled", "disabled");
92 return qx.ui.basic.Terminator.prototype._modifyEnabled.call(this, propValue, propOldValue, propData);