home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 January / 01_02.iso / software / netscape62win / browser.xpi / bin / chrome / toolkit.jar / content / global / bindings / checkbox.xml < prev    next >
Encoding:
Extensible Markup Language  |  2001-08-19  |  1.7 KB  |  45 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="checkboxBindings"
  4.    xmlns="http://www.mozilla.org/xbl"
  5.    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  6.  
  7.   <binding id="checkbox" extends="chrome://global/content/bindings/checkbox.xml#checkbox-baseline">
  8.     <resources>
  9.       <stylesheet src="chrome://global/skin/checkbox.css"/>
  10.     </resources>
  11.   </binding>
  12.  
  13.   <binding id="checkbox-baseline" extends="chrome://global/content/bindings/general.xml#basetext">
  14.     <content>
  15.       <xul:hbox flex="1" class="internal-box" align="center">
  16.         <xul:hbox class="checkmark-box" align="center">
  17.           <xul:image class="checkbox-check"/>
  18.         </xul:hbox>
  19.         <xul:image class="checkbox-icon" inherits="src"/>
  20.         <xul:html class="checkbox-label" inherits="value=label,accesskey,crop" flex="1"/>
  21.       </xul:hbox>
  22.     </content>
  23.     
  24.     <implementation>
  25.       <!-- public implementation -->
  26.       <property name="checked"    onset="if (val) this.setAttribute('checked', 'true');
  27.                                          else this.removeAttribute('checked');
  28.                                          return val;"
  29.                                   onget="var v = this.getAttribute('checked');
  30.                                          if (v == 'true') return true; return false;"/>
  31.     </implementation>
  32.     <handlers>
  33.       <handler event="click" button="0" action="if (!this.disabled) this.checked = !this.checked;"/>
  34.       <handler event="keypress" key=" ">
  35.         <![CDATA[
  36.           if (!this.disabled) {
  37.             this.checked = !this.checked;
  38.             this.doCommand();
  39.           }
  40.         ]]>
  41.       </handler>
  42.     </handlers>
  43.   </binding>
  44.  
  45. </bindings>