// ScrollWindow Object // a widget that draws layers that are to be scrolled, being built for a new Scroll Object // 19991011 // Copyright (C) 1999 Dan Steinman // Distributed under the terms of the GNU Library General Public License // Available at http://www.dansteinman.com/dynapi/ function ScrollWindow(x,y,width,height,frame,name) { this.name=(name!=null)? name : "ScrollWindow"+(ScrollWindow.count++) this.w=width this.h=height this.frame=(is.ie && frame!=null)? window.top.frames[frame] : parent this.obj=this.name+"Object" eval(this.obj+"=this") this.setMargins=ScrollWindowSetMargins this.setMargins(0,0,0,0) } {var p=ScrollWindow.prototype p.usebuffer=true p.inlineBlocks=0 p.inc=10 p.speed=20 p.border=1 p.borderColor='black' p.bgColor=null p.build=ScrollWindowBuild p.activate=ScrollWindowActivate p.up=ScrollWindowUp p.down=ScrollWindowDown p.left=ScrollWindowLeft p.right=ScrollWindowRight p.stop=ScrollWindowStop p.getXfactor=ScrollWindowGetXfactor p.getYfactor=ScrollWindowGetYfactor p.load=ScrollWindowLoad p.reload=ScrollWindowReload p.back=ScrollWindowBack p.forward=ScrollWindowForward p.writeContent=ScrollWindowWriteContent p.showBlock=ScrollWindowShowBlock p.jumpTo=ScrollWindowJumpTo p.history=new Array() p.historyLoc=-1 p.historyLen=-1 p.onScroll=new Function() p.onLoad=new Function() } function ScrollWindowSetMargins(l,r,t,b) { this.marginL=l this.marginR=r this.marginT=t this.marginB=b } function ScrollWindowBuild() { var w=this.w var h=this.h var b=this.border var bc=this.borderColor var ml=this.marginL var mr=this.marginR var mt=this.marginT var mb=this.marginB this.css=css(this.name,this.x,this.y,w,h,null,null,null,'overflow:hidden')+ css(this.name+'Screen',b,b,w-2*b,h-2*b,this.bgColor) if (this.border>0) this.css+=css(this.name+'BorderT',0,0,w,b,bc)+css(this.name+'BorderB',0,h-b,w,b,bc)+css(this.name+'BorderL',0,0,b,h,bc)+css(this.name+'BorderR',w-b,0,b,h,bc) if (this.inlineBlocks) { this.css+=css(this.name+'Content',0,0,w-2*b,null) this.css+=css(this.name+'Block0',ml,mt,w-2*b-ml-mr,null,this.bgColor) for (var i=1;i\n':'' this.divStart+='
'+ '
' if (is.ie && !this.usebuffer) this.divStart+='\n' else this.divStart+='
' this.divEnd='
' if (is.ns || this.usebuffer) this.divEnd+='
' if (this.border>0) this.divEnd+='
\n' this.divEnd+='
' this.div=this.divStart+this.divEnd } function ScrollWindowActivate(w,h) { if (!this.activated) { this.lyr=new DynLayer(this.name) this.screenlyr=new DynLayer(this.name+'Screen') this.blocklyr=new Array() this.blockActive=0 } if (this.inlineBlocks) { DynLayerInit() for (var i=0;i0) this.enableHScroll=(this.offsetWidth>0) this.onScroll() this.onLoad() this.activated=true } function ScrollWindowLoad(url) { if (url != this.url) { this.historyLoc+=1 this.historyLen=this.historyLoc this.history[this.historyLen]=url } this.reload(0) } function ScrollWindowBack() { if (this.historyLoc>0) this.reload(-1) } function ScrollWindowForward() { if (this.historyLoc