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 ************************************************************************ */
26 A checkbox for the menu system.
28 qx.OO.defineClass("qx.ui.menu.CheckBox", qx.ui.menu.Button,
29 function(vLabel, vCommand, vChecked)
31 qx.ui.menu.Button.call(this, vLabel, "static/image/blank.gif", vCommand);
33 if (qx.util.Validation.isValidBoolean(vChecked)) {
34 this.setChecked(vChecked);
37 qx.manager.object.ImageManager.getInstance().preload("widget/menu/checkbox.gif");
43 ---------------------------------------------------------------------------
45 ---------------------------------------------------------------------------
48 qx.OO.changeProperty({ name : "appearance", type : "string", defaultValue : "menu-check-box" });
49 qx.OO.addProperty({ name : "name", type : "string" });
50 qx.OO.addProperty({ name : "value", type : "string" });
51 qx.OO.addProperty({ name : "checked", type : "boolean", defaultValue : false, getAlias : "isChecked" });
58 ---------------------------------------------------------------------------
60 ---------------------------------------------------------------------------
63 qx.Proto._modifyChecked = function(propValue, propOldValue, propData)
65 propValue ? this.addState("checked") : this.removeState("checked");
66 this.getIconObject().setSource(propValue ? "widget/menu/checkbox.gif" : "static/image/blank.gif");
76 ---------------------------------------------------------------------------
78 ---------------------------------------------------------------------------
81 qx.Proto.execute = function()
83 this.setChecked(!this.getChecked());
84 qx.ui.menu.Button.prototype.execute.call(this);