home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / phoenix / chrome / toolkit.jar / content / global / widgets / progressmeter.xml < prev    next >
Extensible Markup Language  |  2002-10-13  |  2KB  |  53 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="progressmeterBindings"
  4.    xmlns="http://www.mozilla.org/xbl"
  5.    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  6.    xmlns:xbl="http://www.mozilla.org/xbl">
  7.  
  8.   <binding id="progressmeter">
  9.     <resources>
  10.       <stylesheet src="chrome://global/skin/progressmeter.css"/>
  11.     </resources>
  12.  
  13.     <content>
  14.       <xul:spacer class="progress-bar" xbl:inherits="mode"/>
  15.       <xul:spacer class="progress-remainder" xbl:inherits="mode"/>
  16.     </content>
  17.     
  18.     <implementation implements="nsIAccessibleProvider">     
  19.       <property name="label" onset="if (this.label != val) this.setAttribute('label',val); return val;"
  20.                                       onget="return this.getAttribute('label');"/>
  21.  
  22.       <property name="mode" onset="if (this.mode != val) this.setAttribute('mode', val); return val;"
  23.                             onget="return this.getAttribute('mode');"/>
  24.  
  25.       <property name="value" onget="return this.getAttribute('value');">
  26.         <setter><![CDATA[
  27.           var p = Math.round(val);
  28.           var c = this.value; 
  29.           if (p != c) {
  30.             var delta = p - c;
  31.             if (delta < 0)
  32.               delta = -delta;
  33.             if (delta > 3 || p == 0 || p == 100)
  34.               this.setAttribute("value", p);
  35.           }
  36.           
  37.           return p;
  38.         ]]></setter>
  39.       </property>
  40.  
  41.       <property name="accessible">
  42.         <getter>
  43.           <![CDATA[
  44.             var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
  45.             return accService.createXULProgressMeterAccessible(this);
  46.           ]]>
  47.         </getter>
  48.       </property>
  49.     </implementation>
  50.   </binding>
  51.  
  52. </bindings>
  53.