home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Programy / nsb-install-8-0.exe / chrome / toolkit.jar / content / global / bindings / scrollbox.xml < prev    next >
Extensible Markup Language  |  2005-07-29  |  2KB  |  73 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" collapsed="true"
  25.                             oncommand="this.parentNode.scrollByIndex(-1); event.preventBubble();"/>
  26.       <xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1">
  27.         <children/>
  28.       </xul:scrollbox>
  29.       <xul:autorepeatbutton class="autorepeatbutton-down" collapsed="true"
  30.                             oncommand="this.parentNode.scrollByIndex(1); event.preventBubble();"/>
  31.     </content>
  32.     
  33.     <implementation>
  34.       <method name="scrollByIndex">
  35.         <parameter name="lines"/>
  36.         <body><![CDATA[
  37.           if (!("mScrollBoxObject" in this)) {
  38.             var kids = document.getAnonymousNodes(this);
  39.             this.mScrollBoxObject = kids[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
  40.           }
  41.  
  42.           this.mScrollBoxObject.scrollByIndex(lines);
  43.         ]]></body>
  44.       </method>            
  45.     </implementation>    
  46.  
  47.     <handlers>
  48.       <handler event="DOMMouseScroll" action="this.scrollByIndex(event.detail); event.preventBubble();"/>
  49.  
  50.       <handler event="underflow"><![CDATA[
  51.         var kids = document.getAnonymousNodes(this);
  52.         kids[0].collapsed = true;
  53.         kids[2].collapsed = true;
  54.         event.preventBubble();
  55.       ]]></handler>
  56.  
  57.       <handler event="overflow"><![CDATA[
  58.         var kids = document.getAnonymousNodes(this);
  59.         kids[0].collapsed = false;
  60.         kids[2].collapsed = false;
  61.         event.preventBubble();
  62.       ]]></handler>
  63.     </handlers>
  64.   </binding>
  65.  
  66.   <binding id="autorepeatbutton" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
  67.     <content>
  68.       <xul:image class="autorepeatbutton-icon"/>
  69.     </content>
  70.   </binding>
  71.  
  72. </bindings>
  73.