<?xml version="1.0"?>

<bindings id="menulistBindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:html="http://www.w3.org/1999/xhtml"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<!-- 
  BINDING : menulist
  XUL REPRESENTATION : <menulist>
  -->
  <binding id="menulist">
    <content excludes="template,observes,menupopup">
      <xul:image class="menu-icon" inherits="src"/>
      <xul:text class="menu-text" flex="1" inherits="value,accesskey,crop" crop="right"/>
      <xul:image class="menu-dropmarker"/>
    </content>
	  <handlers>
      <handler type="command" capturer="true" value="this.selectedItem = event.target; this.data = this.selectedItem.data;"/>
	  </handlers>
    <interface>
      <property name="data" onset="this.setAttribute('data',val); return val;"
                            onget="return this.getAttribute('data');"/>
    </interface>  
  </binding>

<!-- 
  BINDING : menulist-editable
  XUL REPRESENTATION : <menulist editable="true">
  -->
  <binding id="menulist-editable">
    <content excludes="template,observes,menupopup">
      <xul:image class="menu-icon" inherits="src"/>
	    <html:input type="text" flex="1" class="menu-text" allowevents="true" inherits="value,disabled"/>
      <xul:image class="menu-dropmarker"/>
    </content>
	  <handlers>
      <handler type="command" capturer="true" value="this.selectedItem = event.target"/>
	  </handlers>
  </binding>
  
<!-- 
  BINDING : menubutton-single
  XUL REPRESENTATION : <menubutton>
  -->
  <binding id="menubutton-single-right">
    <content excludes="template,observes,menupopup">
      <xul:box class="menubutton-internal-box" autostretch="never">
        <xul:text class="menubutton-single-text" inherits="value,crop,accesskey"/>
        <xul:image class="menubutton-single-icon"/>
      </xul:box>
    </content>
  </binding>

  <binding id="menubutton-single-left">
    <content excludes="template,observes,menupopup">
      <xul:box class="menubutton-internal-box" autostretch="never">
        <xul:image class="menubutton-single-icon"/>
        <xul:text class="menubutton-single-text" inherits="value,crop,accesskey"/>
      </xul:box>
    </content>
  </binding>
  
<!-- 
  BINDING : menubutton-icon
  XUL REPRESENTATION : <menubutton class="menubutton-icon">
  -->
  <binding id="menubutton-icon">
    <content excludes="template,observes,menupopup">
      <xul:box class="menubutton-icon-internal-box" autostretch="never">
        <xul:image class="menubutton-icon-icon" inherits="src"/>
      </xul:box>
    </content>
  </binding>
  
<!-- 
  BINDING : menubutton-dual
  XUL REPRESENTATION : <menubutton class="menubutton-dual">
  -->
  <binding id="menubutton-dual-top">
    <content excludes="template,observes,menupopup">
      <xul:box class="menubutton-internal-box">
        <xul:button class="menubutton-dual-button top" allowevents="true" 
                    inherits="buttontooltiptext:tooltiptext,buttonaction:oncommand,src,value,crop,accesskey"/>
        <xul:box class="menubutton-dual-dropmarker-box" autostretch="never" valign="middle">
          <xul:image class="menubutton-dropmarker"/>
        </xul:box>
      </xul:box>
    </content>
  </binding>

  <binding id="menubutton-dual-left">
    <content excludes="template,observes,menupopup">
      <xul:box class="menubutton-internal-box">
        <xul:button class="menubutton-dual-button left" allowevents="true" 
                    inherits="buttontooltiptext:tooltiptext,buttonaction:oncommand,src,value,crop,accesskey"/>
        <xul:box class="menubutton-dual-dropmarker-box" autostretch="never" valign="middle">
          <xul:image class="menubutton-dropmarker"/>
        </xul:box>
      </xul:box>
    </content>
  </binding>

  <binding id="menubutton-dual-right">
    <content excludes="template,observes,menupopup">
      <xul:box class="menubutton-internal-box">
        <xul:button class="menubutton-dual-button right" allowevents="true" 
                    inherits="buttontooltiptext:tooltiptext,buttonaction:oncommand,src,value,crop,accesskey"/>
        <xul:box class="menubutton-dual-dropmarker-box" autostretch="never" valign="middle">
          <xul:image class="menubutton-dropmarker"/>
        </xul:box>
      </xul:box>
    </content>
  </binding>

  <binding id="menubutton-dual-bottom">
    <content excludes="template,observes,menupopup">
      <xul:box class="menubutton-internal-box">
        <xul:button class="menubutton-dual-button bottom" allowevents="true" 
                    inherits="buttontooltiptext:tooltiptext,buttonaction:oncommand,src,value,crop,accesskey"/>
        <xul:box class="menubutton-dual-dropmarker-box" autostretch="never" valign="middle">
          <xul:image class="menubutton-dropmarker"/>
        </xul:box>
      </xul:box>
    </content>
  </binding>

<!--
  BINDING : menubutton-item
  XUL REPRESENTATION : menuitem
  -->  
  <binding id="menubutton-item">
    <content autostretch="never" excludes="template,observes,menupopup">
      <xul:text class="menubutton-text" flex="1" inherits="value,accesskey,crop" crop="right"/>
    </content>
  </binding>  
  
  
</bindings>