home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / mozil06.zip / bin / chrome / toolkit.jar / content / global / xulBindings.xml < prev   
Extensible Markup Language  |  2001-02-14  |  33KB  |  728 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="xulBindings"
  4.    xmlns="http://www.mozilla.org/xbl"
  5.    xmlns:html="http://www.w3.org/1999/xhtml"
  6.    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  7.   
  8.   <binding id="thumb" extends="xul:box">
  9.     <content>
  10.       <xul:spring flex="1"/>
  11.           <xul:image inherits="src"/>
  12.           <xul:spring flex="1"/>
  13.     </content>
  14.   </binding>
  15.  
  16.   <binding id="scrollbar">
  17.     <content>
  18.       <xul:scrollbarbutton type="decrement">
  19.           <xul:image inherits="src"/>
  20.         </xul:scrollbarbutton>
  21.       <xul:slider flex="1" inherits="curpos,maxpos,pageincrement,increment">
  22.           <xul:thumb inherits="align,src" flex="1"/>
  23.       </xul:slider>
  24.       <xul:scrollbarbutton type="increment">
  25.         <xul:image inherits="src"/>
  26.       </xul:scrollbarbutton>
  27.     </content>
  28.   </binding>
  29.  
  30.   <binding id="slider">
  31.     <content>
  32.       <xul:button align="horizontal"/>
  33.     </content>
  34.   </binding>
  35.  
  36.   <binding id="tab">
  37.     <content>
  38.       <xul:image inherits="src" class="tab-left"/>
  39.       <xul:text flex="1" inherits="value,crop,accesskey" crop="right" class="tab-text"/>
  40.     </content>
  41.   </binding>
  42.  
  43.  
  44.   <binding id="menu-menubar">
  45.     <content includes="menupopup">
  46.       <xul:text class="menubar-text" inherits="value,accesskey,crop" crop="right"/>
  47.     </content>
  48.   </binding>
  49.  
  50.   <binding id="menu-menubar-iconic">
  51.     <content includes="menupopup">
  52.       <xul:image class="menubar-left"/>
  53.       <xul:text class="menubar-text" inherits="value,accesskey,crop" crop="right"/>
  54.     </content>
  55.   </binding>
  56.  
  57.   <binding id="menu">
  58.     <content autostretch="never" includes="menupopup">
  59.       <xul:text class="menu-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  60.       <xul:text class="menu-accel" inherits="acceltext:value"/>
  61.       <xul:box autostretch="never" class="menu-right" inherits="menuactive,disabled">
  62.         <xul:image/>
  63.       </xul:box>
  64.     </content>
  65.     <implementation>
  66.       <property name="data" onset="this.setAttribute('data',val); return val;"
  67.                             onget="return this.getAttribute('data');"/>
  68.     </implementation>  
  69.   </binding>
  70.  
  71.   <binding id="menuitem">
  72.     <content autostretch="never" includes="menupopup">
  73.       <xul:text class="menu-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  74.       <xul:text class="menu-accel" inherits="value=acceltext"/>
  75.     </content>
  76.     <implementation>
  77.       <property name="data" onset="this.setAttribute('data',val); return val;"
  78.                             onget="return this.getAttribute('data');"/>
  79.     </implementation>  
  80.   </binding>
  81.  
  82.   <binding id="menuitem-iconic">
  83.     <content includes="menupopup">
  84.       <xul:box class="menu-iconic-left" orient="vertical" autostretch="never" inherits="selected,menuactive,disabled,checked">
  85.         <xul:image/>
  86.       </xul:box>
  87.       <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  88.       <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
  89.     </content>
  90.     <implementation>
  91.       <property name="data" onset="this.setAttribute('data',val); return val;"
  92.                             onget="return this.getAttribute('data');"/>
  93.     </implementation>  
  94.   </binding>
  95.  
  96.   <binding id="menu-iconic">
  97.     <content autostretch="never" includes="menupopup">
  98.       <xul:box class="menu-iconic-left" orient="vertical" autostretch="never">
  99.         <xul:image/>
  100.       </xul:box>
  101.       <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  102.       <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
  103.       <xul:box orient="vertical" autostretch="never" class="menu-right" inherits="menuactive,disabled">
  104.         <xul:image/>
  105.       </xul:box>
  106.     </content>
  107.     <implementation>
  108.       <property name="data" onset="this.setAttribute('data',val); return val;"
  109.                             onget="return this.getAttribute('data');"/>
  110.     </implementation>  
  111.   </binding>
  112.   
  113.   <binding id="basetext">
  114.     <implementation>
  115.       <!-- public implementation -->
  116.       <property name="value"      onset="return this.setAttribute('value',val);"
  117.                                   onget="return this.getAttribute('value');"/>
  118.       <property name="crop"       onset="return this.setAttribute('crop',val);"
  119.                                   onget="return this.getAttribute('crop');"/>
  120.       <property name="disabled"   onset="if (val) this.setAttribute('disabled', 'true');
  121.                                          else this.removeAttribute('disabled');
  122.                                          return val;"
  123.                                   onget="var v = this.getAttribute('disabled');
  124.                                          if (v == 'true') return true; return false;"/>                                  
  125.       <property name="src"        onset="return this.setAttribute('src',val);"
  126.                                   onget="return this.getAttribute('src');"/>
  127.       <property name="accesskey"  onset="return this.setAttribute('accesskey',val);"
  128.                                   onget="return this.getAttribute('accesskey');"/>
  129.       <property name="imgalign"   onset="return this.setAttribute('imgalign',val);"
  130.                                   onget="return this.getAttribute('imgalign');"/>
  131.     </implementation>      
  132.   </binding>
  133.   
  134.   <binding id="checkbox" extends="chrome://global/content/xulBindings.xml#basetext">
  135.     <content>
  136.       <xul:box flex="1" class="internal-box" autostretch="never" valign="top">
  137.         <xul:box class="checkmark-box" autostretch="never">
  138.           <xul:image class="checkbox-check"/>
  139.         </xul:box>
  140.         <xul:image class="checkbox-icon" inherits="src"/>
  141.         <xul:html inherits="value,accesskey,crop" flex="1">
  142.           <children/>
  143.         </xul:html>
  144.       </xul:box>
  145.     </content>
  146.     <implementation>
  147.       <!-- public implementation -->
  148.       <property name="checked"    onset="if (val) this.setAttribute('checked', 'true');
  149.                                          else this.removeAttribute('checked');
  150.                                          return val;"
  151.                                   onget="var v = this.getAttribute('checked');
  152.                                          if (v == 'true') return true; return false;"/>
  153.     </implementation>
  154.     <handlers>
  155.       <handler event="click">
  156.       <![CDATA[
  157.         if (!this.disabled) this.checked = !this.checked; 
  158.       ]]>
  159.       </handler>
  160.       <handler event="keypress" key=" " action="if (!this.disabled) this.checked = !this.checked;"/>
  161.     </handlers>
  162.   </binding>
  163.  
  164.   <!-- XUL <button>s -->
  165.   <binding id="buttonleft" extends="chrome://global/content/xulBindings.xml#basetext">
  166.     <content>
  167.         <xul:box class="button-internal-box" autostretch="never" flex="1">
  168.         <xul:image class="button-icon" inherits="src"/>
  169.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  170.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  171.         </xul:box>
  172.       </xul:box>
  173.     </content>
  174.   </binding>
  175.  
  176.   <binding id="buttontop" extends="chrome://global/content/xulBindings.xml#basetext">
  177.     <content>
  178.         <xul:box class="button-internal-box" orient="vertical" autostretch="never" flex="1">
  179.         <xul:image class="button-icon" inherits="src"/>
  180.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  181.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  182.         </xul:box>
  183.       </xul:box>
  184.     </content>
  185.   </binding>
  186.   
  187.   <binding id="buttonright" extends="chrome://global/content/xulBindings.xml#basetext">
  188.     <content>
  189.         <xul:box class="button-internal-box" inherits="orient" autostretch="never" flex="1">
  190.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  191.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  192.         </xul:box>
  193.         <xul:image class="button-icon" inherits="src"/>
  194.       </xul:box>
  195.     </content>
  196.   </binding>
  197.  
  198.   <binding id="buttonbottom" extends="chrome://global/content/xulBindings.xml#basetext">
  199.     <content>
  200.         <xul:box class="button-internal-box" orient="vertical" autostretch="never" flex="1">
  201.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  202.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  203.         </xul:box>
  204.         <xul:image class="button-icon" inherits="src"/>
  205.       </xul:box>
  206.     </content>
  207.   </binding>
  208.   
  209.   <binding id="separator" extends="xul:spring"/>
  210.  
  211.   <!-- appending to the end so we don't make hyatt cry -->
  212.   <binding id="progressmeter" extends="xul:box">
  213.     <content>
  214.       <xul:box class="progressmeter-internal-box" flex="1">
  215.         <xul:stack class="progressmeter-stack" flex="1">
  216.           <xul:progressbar class="progressmeter-progressbar" inherits="value,statusbar">
  217.             <xul:box class="progress-bar"/>
  218.             <xul:box class="progress-remainder"/>
  219.           </xul:progressbar>
  220.           <xul:box>
  221.             <xul:spring flex="1"/>
  222.             <xul:text class="progress-text" inherits="progresstext:value"/>
  223.             <xul:spring flex="1"/>
  224.           </xul:box>
  225.         </xul:stack>
  226.       </xul:box>
  227.     </content>
  228.     <implementation>
  229.       <property name="progresstext"   onset="this.setAttribute('progresstext',val); return val;"
  230.                                       onget="return this.getAttribute('progresstext');"/>
  231.       <property name="value"          onset="this.setAttribute('value',val); return val;"
  232.                                       onget="return this.getAttribute('value');"/>
  233.       <property name="mode"           onset="this.setAttribute('mode', val); return val;"
  234.                                       onget="return this.getAttribute('mode');"/>
  235.     </implementation>
  236.   </binding>
  237.  
  238.   <binding id="textfield" extends="xul:box">
  239.     <content>
  240.       <xul:box class="textfield-internal-box" flex="1">
  241.         <html:input class="textfield-input" flex="1" inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly"/>
  242.       </xul:box>
  243.     </content>
  244.     <implementation>
  245.       <property name="inputField" readonly="true">
  246.        <![CDATA[
  247.         var v = document.getAnonymousNodes(this);
  248.         var input = null;
  249.         for (var i = 0; i < v.length; i++) {
  250.           try {
  251.             var l = v[i].getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "input");
  252.             if (l.length > 0) {
  253.               input = l[0];
  254.               break;
  255.             }
  256.           } catch (e) {} 
  257.         }
  258.         input;
  259.       ]]>
  260.       </property>
  261.       <property name="value"      onset="this.inputField.value = val; return val;"
  262.                                   onget="return this.inputField.value;"/>
  263.       <property name="type"       onset="this.inputField.type = val; return val;"
  264.                                   onget="return this.inputField.type;"/>
  265.       <property name="maxlength"  onset="this.inputField.maxlength = val; return val;"
  266.                                   onget="return this.inputField.maxlength;"/>
  267.       <property name="disabled"   onset="this.inputField.disabled = val; return val;"
  268.                                   onget="return this.inputField.disabled;"/>
  269.       <property name="size"       onset="this.inputField.size = val; return val;"
  270.                                   onget="return this.inputField.size;"/>
  271.       <property name="readonly"   onset="this.inputField.readonly = val; return val;"
  272.                                   onget="return this.inputField.readonly;"/>
  273.  
  274.       <method name="select">
  275.         <body>
  276.           this.inputField.select();
  277.         </body>
  278.       </method>
  279.       
  280.       <property name="controllers"    readonly="true" onget="return this.inputField.controllers"/>
  281.       <property name="textLength"     readonly="true" onget="return this.inputField.textLength;"/>
  282.       <property name="selectionStart" onset="this.inputField.selectionStart = val; return val;"
  283.                                       onget="return this.inputField.selectionStart;"/>
  284.       <property name="selectionEnd"   onset="this.inputField.selectionEnd = val; return val;"
  285.                                       onget="return this.inputField.selectionEnd;"/>
  286.      
  287.       <property name="suppressFocusBlur">
  288.         false
  289.       </property>
  290.  
  291.       <method name="setSelectionRange">
  292.         <parameter name="aSelectionStart"/>
  293.         <parameter name="aSelectionEnd"/>
  294.         <body>
  295.           this.inputField.setSelectionRange( aSelectionStart, aSelectionEnd );
  296.         </body>
  297.       </method>
  298.  
  299.     </implementation>
  300.     <handlers>
  301.       <handler event="focus" phase="capturing">
  302.       <![CDATA[
  303.         if (this.getAttribute('focused') != 'true') {
  304.           this.setAttribute('focused','true');
  305.           this.suppressFocusBlur = true;
  306.           if (document.commandDispatcher.focusedElement != this.inputField) 
  307.             this.inputField.focus();
  308.           this.suppressFocusBlur = false;
  309.         }
  310.       ]]>
  311.       </handler>
  312.       <handler event="blur" phase="capturing">
  313.       <![CDATA[
  314.         if (!this.suppressFocusBlur && this.getAttribute('focused') == 'true') {
  315.           this.removeAttribute('focused');
  316.         }
  317.       ]]>
  318.       </handler>
  319.       <!-- Ensure that our state gets saved/restored across skin switches. -->
  320.        <handler event="bindingattached" action="var str = this.boxObject.getProperty('value'); 
  321.                                                 if (str) {
  322.                                                   this.inputField.value=str;
  323.                                                   this.boxObject.removeProperty('value');
  324.                                                 }"/>
  325.        <handler event="bindingdetached" action="if (this.inputField.value) this.boxObject.setProperty('value', this.inputField.value);"/>
  326.    </handlers>    
  327.   </binding>
  328.  
  329.   <binding id="textarea" extends="chrome://global/content/xulBindings.xml#textfield">
  330.     <content>
  331.       <xul:box class="textarea-internal-box" flex="1">
  332.         <html:textarea class="textfield-textarea" flex="1" inherits="onfocus,onblur,value,disabled,rows,cols,readonly"/>
  333.       </xul:box>
  334.     </content>
  335.     <implementation>
  336.       <property name="inputField" readonly="true">
  337.        <![CDATA[
  338.         var v = document.getAnonymousNodes(this);
  339.         var input = null;
  340.         for (var i = 0; i < v.length; i++) {
  341.           try {
  342.             var l = v[i].getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "textarea");
  343.             if (l.length > 0) {
  344.               input = l[0];
  345.               break;
  346.             }
  347.           } catch (e) {} 
  348.         }
  349.         input;
  350.       ]]>
  351.       </property>
  352.     </implementation>
  353.   </binding>
  354.  
  355.   <binding id="text-label">
  356.     <handlers>
  357.       <handler event="click" action="var forElementID = this.getAttribute('for'); if(forElementID) var forElement = document.getElementById(forElementID); if(forElement) forElement.focus();"/>
  358.     </handlers>
  359.   </binding>
  360.   
  361.   <binding id="text-editable-display" extends="chrome://global/content/xulBindings.xml#text"/>
  362.   
  363.   <binding id="text-editable-edit" extends="xul:box">
  364.     <content>
  365.       <xul:box flex="1">
  366.         <html:input type="text" inherits="value,type,maxlength,disabled,size,readonly"/>
  367.       </xul:box>
  368.     </content>
  369.     <handlers>
  370.       <handler event="blur" action="this.setAttribute('mode','display');"/>
  371.     </handlers>
  372.   </binding>
  373.  
  374.   <binding id="tooltips" extends="chrome://global/content/xulBindings.xml#popups">
  375.     <content>
  376.       <xul:box class="popup-internal-box" orient="vertical" flex="1">
  377.         <children/>
  378.       </xul:box>
  379.     </content>
  380.   </binding>
  381.  
  382.   <binding id="popups">
  383.     <content>
  384.       <!--xul:box class="popup-internal-box" orient="vertical" flex="1" style="overflow: auto">
  385.         <children/>
  386.       </xul:box-->
  387.  
  388.       <xul:arrowscrollbox class="popup-internal-box" flex="1" orient="vertical">
  389.           <!--xul:box class="popup-internal-box" orient="vertical"-->
  390.             <children/>
  391.           <!--/xul:box-->
  392.       </xul:arrowscrollbox>
  393.  
  394.     </content>
  395.     <implementation>
  396.       <method name="openPopup">
  397.         <parameter name="element"/>
  398.         <parameter name="xpos"/>
  399.         <parameter name="ypos"/>
  400.         <parameter name="popuptype"/>
  401.         <parameter name="anchoralignment"/>
  402.         <parameter name="popupalignment"/>
  403.         <body>
  404.         <![CDATA[
  405.           try {
  406.             var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  407.             var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  408.           } catch(e) {}
  409.           if (popupSetBox)
  410.             popupSetBox.createPopup(element, this, xpos, ypos, popuptype, anchoralignment, popupalignment);
  411.           else if (menuBox)
  412.             menuBox.openMenu(true);
  413.         ]]>
  414.         </body>
  415.       </method>
  416.       <method name="closePopup">
  417.         <body>
  418.         <![CDATA[
  419.           try {
  420.             var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  421.             var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  422.           } catch(e) {}
  423.           if (popupSetBox)
  424.             popupSetBox.destroyPopup();
  425.           else if (menuBox)
  426.             menuBox.openMenu(false);
  427.         ]]>
  428.         </body>
  429.       </method>
  430.       <property name="activeChild">
  431.         <getter>
  432.           <![CDATA[
  433.             try {
  434.               var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  435.               var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  436.             } catch(e) {}
  437.             if (popupSetBox)
  438.               return popupSetBox.activeChild;
  439.             else if (menuBox)
  440.               return menuBox.activeChild;
  441.           ]]>
  442.         </getter>
  443.         <setter>
  444.           <![CDATA[
  445.             try {
  446.               var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  447.               var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  448.             } catch(e) {}
  449.             if (popupSetBox)
  450.               return popupSetBox.activeChild = val;
  451.             else if (menuBox)
  452.               return menuBox.activeChild = val;
  453.           ]]>
  454.         </setter>
  455.       </property>
  456.     </implementation>     
  457.   </binding>
  458.   
  459.   <binding id="colorpicker" extends="xul:box">
  460.     <implementation>
  461.       <property name="color" onset="return this.setAttribute('color', val);"
  462.                              onget="return this.getAttribute('color');"/>
  463.       <property name="selectedItem"/>
  464.     </implementation>
  465.     <content>
  466.  
  467.       <xul:box flex="1" orient="vertical" onclick="parentNode.color = event.target.getAttribute('color');
  468.                                                    try { parentNode.selectedItem.removeAttribute('selected'); } catch(e) { }
  469.                                                    parentNode.selectedItem = event.target;
  470.                                                    event.target.setAttribute('selected', 'true');">
  471.  
  472.       <xul:box align="horizontal">
  473.         <xul:spring class="colorpickertile" style="background-color: #FFFFFF" color="#FFFFFF"/>
  474.         <xul:spring class="colorpickertile" style="background-color: #FFCCCC" color="#FFCCCC"/>
  475.         <xul:spring class="colorpickertile" style="background-color: #FFCC99" color="#FFCC99"/>
  476.         <xul:spring class="colorpickertile" style="background-color: #FFFF99" color="#FFFF99"/>
  477.         <xul:spring class="colorpickertile" style="background-color: #FFFFCC" color="#FFFFCC"/>
  478.         <xul:spring class="colorpickertile" style="background-color: #99FF99" color="#99FF99"/>
  479.         <xul:spring class="colorpickertile" style="background-color: #99FFFF" color="#99FFFF"/>
  480.         <xul:spring class="colorpickertile" style="background-color: #CCFFFF" color="#CCFFFF"/>
  481.         <xul:spring class="colorpickertile" style="background-color: #CCCCFF" color="#CCCCFF"/>
  482.         <xul:spring class="colorpickertile" style="background-color: #FFCCFF" color="#FFCCFF"/>
  483.       </xul:box>
  484.       <xul:box align="horizontal">
  485.         <xul:spring class="colorpickertile" style="background-color: #CCCCCC" color="#CCCCCC"/>
  486.         <xul:spring class="colorpickertile" style="background-color: #FF6666" color="#FF6666"/>
  487.         <xul:spring class="colorpickertile" style="background-color: #FFCC33" color="#FFCC33"/>
  488.         <xul:spring class="colorpickertile" style="background-color: #FFFF66" color="#FFFF66"/>
  489.         <xul:spring class="colorpickertile" style="background-color: #FFFF99" color="#FFFF99"/>
  490.         <xul:spring class="colorpickertile" style="background-color: #66FF99" color="#66FF99"/>
  491.         <xul:spring class="colorpickertile" style="background-color: #33FFFF" color="#33FFFF"/>
  492.         <xul:spring class="colorpickertile" style="background-color: #66FFFF" color="#66FFFF"/>
  493.         <xul:spring class="colorpickertile" style="background-color: #9999FF" color="#9999FF"/>
  494.         <xul:spring class="colorpickertile" style="background-color: #FF99FF" color="#FF99FF"/>
  495.       </xul:box>
  496.       <xul:box align="horizontal">
  497.         <xul:spring class="colorpickertile" style="background-color: #C0C0C0" color="#C0C0C0"/>
  498.         <xul:spring class="colorpickertile" style="background-color: #FF0000" color="#FF0000"/>
  499.         <xul:spring class="colorpickertile" style="background-color: #FF9900" color="#FF9900"/>
  500.         <xul:spring class="colorpickertile" style="background-color: #FFCC66" color="#FFCC66"/>
  501.         <xul:spring class="colorpickertile" style="background-color: #FFFF00" color="#FFFF00"/>
  502.         <xul:spring class="colorpickertile" style="background-color: #33FF33" color="#33FF33"/>
  503.         <xul:spring class="colorpickertile" style="background-color: #66CCCC" color="#66CCCC"/>
  504.         <xul:spring class="colorpickertile" style="background-color: #33CCFF" color="#33CCFF"/>
  505.         <xul:spring class="colorpickertile" style="background-color: #6666CC" color="#6666CC"/>
  506.         <xul:spring class="colorpickertile" style="background-color: #CC66CC" color="#CC66CC"/>
  507.       </xul:box>
  508.       <xul:box align="horizontal">
  509.         <xul:spring class="colorpickertile" style="background-color: #999999" color="#999999"/>
  510.         <xul:spring class="colorpickertile" style="background-color: #CC0000" color="#CC0000"/>
  511.         <xul:spring class="colorpickertile" style="background-color: #FF6600" color="#FF6600"/>
  512.         <xul:spring class="colorpickertile" style="background-color: #FFCC33" color="#FFCC33"/>
  513.         <xul:spring class="colorpickertile" style="background-color: #FFCC00" color="#FFCC00"/>
  514.         <xul:spring class="colorpickertile" style="background-color: #33CC00" color="#33CC00"/>
  515.         <xul:spring class="colorpickertile" style="background-color: #00CCCC" color="#00CCCC"/>
  516.         <xul:spring class="colorpickertile" style="background-color: #3366FF" color="#3366FF"/>
  517.         <xul:spring class="colorpickertile" style="background-color: #6633FF" color="#6633FF"/>
  518.         <xul:spring class="colorpickertile" style="background-color: #CC33CC" color="#CC33CC"/>
  519.       </xul:box>
  520.       <xul:box align="horizontal">
  521.         <xul:spring class="colorpickertile" style="background-color: #666666" color="#666666"/>
  522.         <xul:spring class="colorpickertile" style="background-color: #990000" color="#990000"/>
  523.         <xul:spring class="colorpickertile" style="background-color: #CC6600" color="#CC6600"/>
  524.         <xul:spring class="colorpickertile" style="background-color: #CC9933" color="#CC9933"/>
  525.         <xul:spring class="colorpickertile" style="background-color: #999900" color="#999900"/>
  526.         <xul:spring class="colorpickertile" style="background-color: #009900" color="#009900"/>
  527.         <xul:spring class="colorpickertile" style="background-color: #339999" color="#339999"/>
  528.         <xul:spring class="colorpickertile" style="background-color: #3333FF" color="#3333FF"/>
  529.         <xul:spring class="colorpickertile" style="background-color: #6600CC" color="#6600CC"/>
  530.         <xul:spring class="colorpickertile" style="background-color: #993399" color="#993399"/>
  531.       </xul:box>
  532.       <xul:box align="horizontal">
  533.         <xul:spring class="colorpickertile" style="background-color: #333333" color="#333333"/>
  534.         <xul:spring class="colorpickertile" style="background-color: #660000" color="#660000"/>
  535.         <xul:spring class="colorpickertile" style="background-color: #993300" color="#993300"/>
  536.         <xul:spring class="colorpickertile" style="background-color: #996633" color="#996633"/>
  537.         <xul:spring class="colorpickertile" style="background-color: #666600" color="#666600"/>
  538.         <xul:spring class="colorpickertile" style="background-color: #006600" color="#006600"/>
  539.         <xul:spring class="colorpickertile" style="background-color: #336666" color="#336666"/>
  540.         <xul:spring class="colorpickertile" style="background-color: #000099" color="#000099"/>
  541.         <xul:spring class="colorpickertile" style="background-color: #333399" color="#333399"/>
  542.         <xul:spring class="colorpickertile" style="background-color: #663366" color="#663366"/>
  543.       </xul:box>
  544.       <xul:box align="horizontal">
  545.         <xul:spring class="colorpickertile" style="background-color: #000000" color="#000000"/>
  546.         <xul:spring class="colorpickertile" style="background-color: #330000" color="#330000"/>
  547.         <xul:spring class="colorpickertile" style="background-color: #663300" color="#663300"/>
  548.         <xul:spring class="colorpickertile" style="background-color: #663333" color="#663333"/>
  549.         <xul:spring class="colorpickertile" style="background-color: #333300" color="#333300"/>
  550.         <xul:spring class="colorpickertile" style="background-color: #003300" color="#003300"/>
  551.         <xul:spring class="colorpickertile" style="background-color: #003333" color="#003333"/>
  552.         <xul:spring class="colorpickertile" style="background-color: #000066" color="#000066"/>
  553.         <xul:spring class="colorpickertile" style="background-color: #330099" color="#330099"/>
  554.         <xul:spring class="colorpickertile" style="background-color: #330033" color="#330033"/>
  555.       </xul:box>
  556.       </xul:box>
  557.     </content>
  558.   </binding>
  559.  
  560.  <!-- NOTE: this should really extend menu, but doing this causes the menupopup to be ignored (bug) -->
  561.   <binding id="colorpickerButton" extends="xul:box">
  562.     <content>
  563.       <xul:menu class="colorpicker-button-menu" allowevents="true" flex="1">
  564.         <xul:box class="colorpicker-button-colorbox" flex="1"/>
  565.         <xul:menupopup class="colorpicker-button-menupopup"
  566.           oncreate="this.parentNode.parentNode.setAttribute('menuactive', 'true')"
  567.           ondestroy="this.parentNode.parentNode.setAttribute('menuactive', 'false')">
  568.           <xul:colorpicker inherits="palettename" allowevents="true"
  569.            onclick="this.parentNode.parentNode.parentNode.pickerClicked(event)"/>
  570.         </xul:menupopup>
  571.       </xul:menu>
  572.     </content>
  573.     
  574.     <implementation>
  575.       <property name="onchange"/>
  576.       
  577.       <property name="color">
  578.         <getter>
  579.           return this.getAttribute("color");
  580.         </getter>
  581.         <setter>
  582.           this.mColorBox.setAttribute("style", "background-color: " + val);
  583.           return this.setAttribute("color", val);
  584.         </setter>
  585.       </property>
  586.       <method name="initialize">
  587.         <body><![CDATA[
  588.           var change = this.getAttribute("onchange");
  589.           if (change) this.onchange = new Function("event", change);
  590.           
  591.           var menu = document.getAnonymousNodes(this)[0];
  592.           this.mPicker = menu.childNodes[1].childNodes[0];
  593.           this.mColorBox = menu.childNodes[0];
  594.         ]]></body>
  595.       </method>
  596.       <method name="pickerClicked">
  597.         <parameter name="aEvent"/>
  598.         <body><![CDATA[
  599.           this.color = this.mPicker.color;
  600.           this.mPicker.parentNode.closePopup();
  601.           if (this.onchange) this.onchange(aEvent);
  602.         ]]></body>
  603.       </method>
  604.     </implementation>
  605.     <handlers>
  606.       <handler event="bindingattached">this.initialize()</handler>
  607.     </handlers>
  608.   </binding>
  609.   
  610.   <!-- XUL <statusbar> -->
  611.   <binding id="statusbar" extends="xul:box"/>
  612.     
  613.   <binding id="statusbar-panel" extends="xul:button">
  614.     <content autostretch="never" valign="middle">
  615.       <xul:image class="statusbar-panel-icon" inherits="src"/>
  616.       <xul:text class="statusbar-panel-text" inherits="value,crop" crop="right" flex="1"/>
  617.     </content>
  618.     <implementation>
  619.       <property name="value"
  620.                 onget="return this.getAttribute('value');"
  621.                 onset="this.setAttribute('value',val); return val;"/>
  622.       <property name="src"
  623.                 onget="return this.getAttribute('src');"
  624.                 onset="this.setAttribute('src',val); return val;"/>
  625.     </implementation>
  626.   </binding>
  627.   
  628.   <binding id="browser">
  629.     <implementation>
  630.       <property name="webBrowser"
  631.                 readonly="true"
  632.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).webBrowser"/>
  633.     </implementation>
  634.   </binding>
  635.  
  636.   <binding id="editor">
  637.     <implementation>
  638.       <property name="editorShell"
  639.                 readonly="true"
  640.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIEditorBoxObject).editorShell"/>
  641.     </implementation>
  642.   </binding>
  643.  
  644.   <binding id="iframe">
  645.     <implementation>
  646.       <property name="docShell"
  647.                 readonly="true"
  648.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIIFrameBoxObject).docShell"/>
  649.     </implementation>
  650.   </binding>
  651.  
  652.   <binding id="titledbox">
  653.     <content>
  654.       <xul:box class="titledbox-title" autostretch="never" orient="vertical">
  655.         <children includes="title"/>
  656.       </xul:box>
  657.       <xul:box flex="1" class="titledbox-body" inherits="orient,autostretch,align,valign">
  658.         <children/>
  659.       </xul:box>
  660.     </content>    
  661.   </binding>
  662.   
  663.   <binding id="titledboxvalue">
  664.     <content>
  665.       <xul:box class="titledbox-title" autostretch="never" orient="vertical">
  666.         <xul:title inherits="value"/>
  667.       </xul:box>
  668.       <xul:box flex="1" class="titledbox-body" inherits="orient,autostretch,align,valign">
  669.         <children/>
  670.       </xul:box>
  671.     </content>    
  672.   </binding>
  673.   
  674.   <binding id="title">
  675.     <content>
  676.       <xul:text inherits="value"/>
  677.     </content>
  678.   </binding>
  679.  
  680.   <binding id="autorepeatbutton-up">
  681.      <content>
  682.         <xul:image class="autorepeatbutton-up"/>
  683.      </content>
  684.   </binding>
  685.  
  686.   <binding id="autorepeatbutton-down">
  687.      <content>
  688.         <xul:image class="autorepeatbutton-down"/>
  689.      </content>
  690.   </binding>
  691.  
  692.   <binding id="scrollbox">
  693.     <content>
  694.       <xul:box class="scrollbox-innerbox" inherits="orient,autostretch,align,valign">
  695.         <children/>
  696.       </xul:box>
  697.     </content>
  698.   </binding>
  699.  
  700.   <binding id="arrowscrollbox" extends="xul:stack">
  701.     <content>
  702.       <xul:vbox 
  703.       onunderflow="
  704.           var button1 = this.firstChild;
  705.           var button2 = this.childNodes[2];
  706.            button1.setAttribute('collapsed', 'true');
  707.           button2.setAttribute('collapsed', 'true');
  708.       " 
  709.       onoverflow="
  710.           var button1 = this.firstChild;
  711.           var button2 = this.childNodes[2];
  712.            button1.removeAttribute('collapsed');
  713.           button2.removeAttribute('collapsed');
  714.       ">
  715.       <xul:autorepeatbutton autostretch="never" class="up" collapsed="true" 
  716.           oncommand="parentNode.childNodes[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject).scrollByIndex(-1);"/>
  717.       <xul:scrollbox orient="vertical" flex="1">
  718.          <children/>
  719.       </xul:scrollbox>
  720.       <xul:autorepeatbutton autostretch="never" class="down" collapsed="true" 
  721.           oncommand="parentNode.childNodes[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject).scrollByIndex(1);"/>
  722.       </xul:vbox>
  723.     </content>
  724.   </binding>
  725.  
  726. </bindings>
  727.  
  728.