home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / phoenix / chrome / toolkit.jar / content / global / bindings / menu.xml < prev    next >
Extensible Markup Language  |  2002-10-03  |  5KB  |  124 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="menuitemBindings"
  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="menuitem-base">
  9.     <resources>
  10.       <stylesheet src="chrome://global/skin/menu.css"/>
  11.     </resources>
  12.     <implementation implements="nsIDOMXULSelectControlItemElement, nsIAccessibleProvider">
  13.       <property name="accessible">
  14.         <getter>
  15.           <![CDATA[
  16.             var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
  17.             if (this.localName == "menuseparator")
  18.               return accService.createXULMenuSeparatorAccessible(this);
  19.             if (this.parentNode && this.parentNode.parentNode &&
  20.                 this.parentNode.localName == "menupopup" && this.parentNode.parentNode.localName == "menulist")
  21.               return accService.createXULSelectOptionAccessible(this);
  22.             return accService.createXULMenuitemAccessible(this);
  23.           ]]>
  24.         </getter>
  25.       </property>
  26.     </implementation>
  27.   </binding>
  28.  
  29.   <binding id="menu" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
  30.     <content>
  31.       <xul:label class="menu-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  32.       <xul:label class="menu-accel" xbl:inherits="value=acceltext"/>
  33.       <xul:hbox align="center" class="menu-right" xbl:inherits="_moz-menuactive,disabled">
  34.         <xul:image/>
  35.       </xul:hbox>
  36.       <children includes="menupopup"/>
  37.     </content>
  38.     
  39.     <implementation>
  40.       <property name="value" onset="this.setAttribute('value',val); return val;"
  41.                             onget="return this.getAttribute('value');"/>
  42.     </implementation>  
  43.   </binding>
  44.  
  45.   <binding id="menuitem" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
  46.     <content>
  47.       <xul:label class="menu-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  48.       <xul:label class="menu-accel" xbl:inherits="value=acceltext"/>
  49.     </content>
  50.     
  51.     <implementation>
  52.       <property name="value" onset="this.setAttribute('value',val); return val;"
  53.                             onget="return this.getAttribute('value');"/>
  54.       <property name="label" onget="return this.getAttribute('label');"
  55.                              onset="this.setAttribute('label', val); return val;"/>
  56.     </implementation>  
  57.   </binding>
  58.  
  59.   <binding id="menu-menubar" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
  60.     <content>
  61.       <xul:label class="menubar-text" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  62.       <children includes="menupopup"/>
  63.     </content>
  64.   </binding>
  65.  
  66.   <binding id="menu-menubar-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
  67.     <content>
  68.       <xul:image class="menubar-left" xbl:inherits="image=src"/>
  69.       <xul:label class="menubar-text" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  70.       <children includes="menupopup"/>
  71.     </content>
  72.   </binding>
  73.  
  74.   <binding id="menuitem-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem">
  75.     <content>
  76.       <xul:hbox class="menu-iconic-left" align="center" pack="center"
  77.                 xbl:inherits="selected,_moz-menuactive,disabled,checked">
  78.         <xul:image class="menu-iconic-icon" xbl:inherits="src=image,validate,src"/>
  79.       </xul:hbox>
  80.       <xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  81.       <xul:label class="menu-iconic-accel" xbl:inherits="value=acceltext"/>
  82.     </content>
  83.   </binding>
  84.  
  85.   <binding id="menuitem-iconic-noaccel" extends="chrome://global/content/bindings/menu.xml#menuitem">
  86.     <content>
  87.       <xul:hbox class="menu-iconic-left" align="center" pack="center"
  88.                 xbl:inherits="selected,disabled,checked">
  89.         <xul:image class="menu-iconic-icon" xbl:inherits="src=image,validate,src"/>
  90.       </xul:hbox>
  91.       <xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  92.     </content>
  93.   </binding>
  94.  
  95.   <binding id="menu-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
  96.     <content>
  97.       <xul:hbox class="menu-iconic-left" align="center" pack="center">
  98.         <xul:image xbl:inherits="src=image"/>
  99.       </xul:hbox>
  100.       <xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  101.       <xul:label class="menu-iconic-accel" xbl:inherits="value=acceltext"/>
  102.       <xul:hbox class="menu-right" xbl:inherits="_moz-menuactive,disabled" align="center" pack="center">
  103.         <xul:image/>
  104.       </xul:hbox>
  105.       <children includes="menupopup|template"/>
  106.     </content>
  107.     
  108.     <implementation>
  109.       <property name="value" onset="this.setAttribute('value',val); return val;"
  110.                             onget="return this.getAttribute('value');"/>
  111.     </implementation>  
  112.   </binding>
  113.   
  114.   <binding id="menubutton-item" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
  115.     <content>
  116.       <xul:label class="menubutton-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
  117.       <children includes="menupopup"/>
  118.     </content>
  119.   </binding>  
  120.   
  121.   <binding id="menuseparator" extends="chrome://global/content/bindings/menu.xml#menuitem-base"/>
  122.  
  123. </bindings>
  124.