<?xml version="1.0"?>

<bindings id="menuitemBindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <binding id="menuitem-base">
    <resources>
      <stylesheet src="chrome://global/skin/menu.css"/>
    </resources>
  </binding>

  <binding id="menu" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
    <content autostretch="never">
      <xul:text class="menu-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
      <xul:text class="menu-accel" inherits="value=acceltext"/>
      <xul:box autostretch="never" class="menu-right" inherits="menuactive,disabled">
        <xul:image/>
      </xul:box>
      <children includes="menupopup"/>
    </content>
    
    <implementation>
      <property name="value" onset="this.setAttribute('value',val); return val;"
                            onget="return this.getAttribute('value');"/>
    </implementation>  
  </binding>

  <binding id="menuitem" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
    <content autostretch="never">
      <xul:text class="menu-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
      <xul:text class="menu-accel" inherits="value=acceltext"/>
    </content>
    
    <implementation>
      <property name="value" onset="this.setAttribute('value',val); return val;"
                            onget="return this.getAttribute('value');"/>
    </implementation>  
  </binding>

  <binding id="menu-menubar" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
    <content>
      <xul:text class="menubar-text" inherits="value=label,accesskey,crop" crop="right"/>
      <children includes="menupopup"/>
    </content>
  </binding>

  <binding id="menu-menubar-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
    <content>
      <xul:image class="menubar-left"/>
      <xul:text class="menubar-text" inherits="value=label,accesskey,crop" crop="right"/>
      <children includes="menupopup"/>
    </content>
  </binding>

  <binding id="menuitem-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
    <content>
      <xul:box class="menu-iconic-left" orient="vertical" autostretch="never"
               inherits="selected,menuactive,disabled,checked">
        <xul:image inherits="src"/>
      </xul:box>
      <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
      <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
    </content>
    
    <implementation>
      <property name="value" onset="this.setAttribute('value',val); return val;"
                            onget="return this.getAttribute('value');"/>
    </implementation>  
  </binding>

  <binding id="menu-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
    <content autostretch="never">
      <xul:box class="menu-iconic-left" orient="vertical" autostretch="never">
        <xul:image inherits="src"/>
      </xul:box>
      <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
      <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
      <xul:box orient="vertical" autostretch="never" class="menu-right" inherits="menuactive,disabled">
        <xul:image/>
      </xul:box>
      <children includes="menupopup|template"/>
    </content>
    
    <implementation>
      <property name="value" onset="this.setAttribute('value',val); return val;"
                            onget="return this.getAttribute('value');"/>
    </implementation>  
  </binding>
  
  <binding id="menubutton-item" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
    <content autostretch="never">
      <xul:text class="menubutton-text" flex="1" inherits="value=label,accesskey,crop" crop="right"/>
      <children includes="menupopup"/>
    </content>
  </binding>  
  
  <binding id="menuseparator" extends="chrome://global/content/bindings/menu.xml#menuitem-base"/>

</bindings>