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

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="arrowscrollboxBindings"
  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="scrollbox-base">
  9.     <resources>
  10.       <stylesheet src="chrome://global/skin/scrollbox.css"/>
  11.     </resources>
  12.   </binding>
  13.  
  14.   <binding id="scrollbox" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
  15.     <content>
  16.       <xul:box class="box-inherit scrollbox-innerbox" xbl:inherits="orient,align,pack,dir">
  17.         <children/>
  18.       </xul:box>
  19.     </content>
  20.   </binding>
  21.  
  22.   <binding id="arrowscrollbox" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
  23.     <content>
  24.       <xul:autorepeatbutton class="autorepeatbutton-up" scrolldir="up" collapsed="true"/>
  25.       <xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1">
  26.         <children/>
  27.       </xul:scrollbox>
  28.       <xul:autorepeatbutton class="autorepeatbutton-down" scrolldir="down" collapsed="true"/> 
  29.     </content>
  30.     
  31.     <handlers>
  32.       <handler event="underflow"><![CDATA[
  33.         var kids = document.getAnonymousNodes(this);
  34.         kids[0].collapsed = true;
  35.         kids[2].collapsed = true;
  36.         event.preventBubble();
  37.       ]]></handler>
  38.  
  39.       <handler event="overflow"><![CDATA[
  40.         var kids = document.getAnonymousNodes(this);
  41.         kids[0].collapsed = false;
  42.         kids[2].collapsed = false;
  43.         event.preventBubble();
  44.       ]]></handler>
  45.     </handlers>
  46.   </binding>
  47.  
  48.   <binding id="autorepeatbutton" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
  49.     <content>
  50.       <xul:image class="autorepeatbutton-icon"/>
  51.     </content>
  52.     
  53.     <handlers>
  54.       <handler event="command"><![CDATA[
  55.         if (!("mScrollBox" in this)) {
  56.           var kids = document.getAnonymousNodes(parentNode);
  57.           this.mScrollBox = kids[1];
  58.         }
  59.         
  60.         var dir = this.getAttribute("scrolldir");
  61.         var bx = this.mScrollBox.boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
  62.         bx.scrollByIndex(dir == "up" ? -1 : 1);
  63.       ]]></handler>
  64.     </handlers>
  65.   </binding>
  66.  
  67. </bindings>