home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 October / tst.iso / multimed / IDN / web / tapdogs / JS / Window.js < prev    next >
Encoding:
JavaScript  |  1999-09-24  |  808 b   |  27 lines

  1. // Lemon (HK) Ltd
  2. // last modified on 30 July 1999
  3.  
  4. function Window(src,lmargin,tmargin,rmargin,bmargin) {
  5.   this.lyr = DragLayer;
  6.   this.lyr(src);
  7.   this.canDrag=WindowCanDrag;
  8.  
  9.   this.lmargin = lmargin ? lmargin : 0;
  10.   this.tmargin = tmargin ? tmargin : 0;
  11.   this.rmargin = rmargin ? rmargin : 0;
  12.   this.bmargin = bmargin ? bmargin : 0;
  13.  
  14.   this.scrollbox = new ScrollBox(src + ".WindowBody");
  15.   this.scrollbox.moveTo(lmargin, tmargin);
  16.   this.scrollbox.resize(this.w-lmargin-rmargin, this.h-tmargin-bmargin);
  17.   this.scrollbox.redraw();
  18. }
  19. function WindowCanDrag(x,y) {
  20.   y-=this.y; x-=this.x;
  21.   return y<=28;
  22. }
  23. function WindowResize(w,h) {
  24.   this.resize(w,h);
  25.   this.scrollbox.resize(this.w-this.lmargin-this.rmargin, this.h-this.tmargin-this.bmargin);
  26.   this.scrollbox.redraw();
  27. }