SOURCE CODE: Uize.Widget.Button.Checkbox

VIEW REFERENCE

/*______________
|       ______  |   U I Z E    J A V A S C R I P T    F R A M E W O R K
|     /      /  |   ---------------------------------------------------
|    /    O /   |    MODULE : Uize.Widget.Button.Checkbox Class
|   /    / /    |
|  /    / /  /| |    ONLINE : http://uize.com
| /____/ /__/_| | COPYRIGHT : (c)2006-2009 UIZE
|          /___ |   LICENSE : Available under MIT License or GNU General Public License
|_______________|             http://uize.com/license.html
*/

/*ScruncherSettings Mappings="=d" LineCompacting="TRUE"*/

/*?
  Introduction
    The =Uize.Widget.Button.Checkbox= class implements a thin wrapper around the button base class in order to support buttons that behave as checkboxes.

    *DEVELOPERS:* `Ben Ilegbodu`, original code donated by `Zazzle, Inc.`

    The =Uize.Widget.Button.Checkbox= module defines the =Uize.Widget.Button.Checkbox= widget class, a subclass of =Uize.Widget.Button=.
*/

Uize.module ({
  name:'Uize.Widget.Button.Checkbox',
  builder:function (_superclass) {
    /*** Class Constructor ***/
      var
        _class = _superclass.subclass (
          function () {
            var _this = this;

            /*** initialization ***/
              _this.wire ('Click',function () {_this.toggle ('selected')});
          }
        )
      ;

    /*** Override Initial Values for Inherited Set-Get Properties ***/
      _class.set ({clickToDeselect:true});

    return _class;
  }
});