home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2003 May
/
PCWorld_2003-05_cd.bin
/
Komunik
/
phoenix
/
chrome
/
toolkit.jar
/
content
/
global
/
widgets
/
scrollbox.xml
< prev
next >
Wrap
Extensible Markup Language
|
2002-10-13
|
2KB
|
67 lines
<?xml version="1.0"?>
<bindings id="arrowscrollboxBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="scrollbox-base">
<resources>
<stylesheet src="chrome://global/skin/scrollbox.css"/>
</resources>
</binding>
<binding id="scrollbox" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
<content>
<xul:box class="box-inherit scrollbox-innerbox" xbl:inherits="orient,align,pack,dir">
<children/>
</xul:box>
</content>
</binding>
<binding id="arrowscrollbox" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
<content>
<xul:autorepeatbutton class="autorepeatbutton-up" scrolldir="up" collapsed="true"/>
<xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1">
<children/>
</xul:scrollbox>
<xul:autorepeatbutton class="autorepeatbutton-down" scrolldir="down" collapsed="true"/>
</content>
<handlers>
<handler event="underflow"><![CDATA[
var kids = document.getAnonymousNodes(this);
kids[0].collapsed = true;
kids[2].collapsed = true;
event.preventBubble();
]]></handler>
<handler event="overflow"><![CDATA[
var kids = document.getAnonymousNodes(this);
kids[0].collapsed = false;
kids[2].collapsed = false;
event.preventBubble();
]]></handler>
</handlers>
</binding>
<binding id="autorepeatbutton" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
<content>
<xul:image class="autorepeatbutton-icon"/>
</content>
<handlers>
<handler event="command"><![CDATA[
if (!("mScrollBox" in this)) {
var kids = document.getAnonymousNodes(parentNode);
this.mScrollBox = kids[1];
}
var dir = this.getAttribute("scrolldir");
var bx = this.mScrollBox.boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
bx.scrollByIndex(dir == "up" ? -1 : 1);
]]></handler>
</handlers>
</binding>
</bindings>