Update of /cvsroot/dynapi/dynapi/src/lib/dynapi/gui
In directory usw-pr-cvs1:/tmp/cvs-serv30523/src/lib/dynapi/gui

Modified Files:
        dynimage.js loadpanel.js scrollbar.js 
Removed Files:
        .jspack 
Log Message:
Imported DynAPIX

Index: dynimage.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/gui/dynimage.js,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** dynimage.js 2001/01/25 21:13:35     1.16
--- dynimage.js 2001/03/25 06:04:16     1.17
***************
*** 22,26 ****
  
  DynImage.listener = new EventListener();
- 
  DynImage.listener.onprecreate = function(e) {
        var o = e.getSource();
--- 22,25 ----
***************
*** 29,33 ****
        }
  };
- 
  DynImage.listener.onresize = function (e) {
        var o = e.getSource();
--- 28,31 ----
***************
*** 116,123 ****
                if (DynImage.onLoaderDone) DynImage.onLoaderDone();
        }
- };
- DynImage.pluginName = "DynImage";
- DynAPI.mountplugin(DynImage);
- DynImage.onLoad = function() {
-       DynImage.loaderStart();
  };
--- 114,117 ----
                if (DynImage.onLoaderDone) DynImage.onLoaderDone();
        }
  };
+ DynAPI.addLoadFunction("DynImage.loaderStart()")

Index: loadpanel.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/gui/loadpanel.js,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** loadpanel.js        2001/03/23 11:37:16     1.11
--- loadpanel.js        2001/03/25 06:04:16     1.12
***************
*** 98,101 ****
--- 98,106 ----
        var p=this.parent;
        this.removeFromParent();
+       // CH: Had to add this code, so NS4 does not recycle the old loadElement.
+       if(is.ns4 && p.doc.recycled.length>0) {
+               delete p.doc.recycled[p.doc.recycled.length-1];
+               p.doc.recycled.length--;
+       }
        this.html = '';
        p.addChild(this);
***************
*** 162,166 ****
                        }
                }
!               DynAPI.removeFromArray(this.queue,this.index);
        }
  };
--- 167,171 ----
                        }
                }
!               Methods.removeFromArray(this.queue,this.index);
        }
  };

Index: scrollbar.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/gui/scrollbar.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** scrollbar.js        2000/12/14 02:56:56     1.6
--- scrollbar.js        2001/03/25 06:04:16     1.7
***************
*** 1,168 ****
! /*
!    DynAPI Distribution
!    ScrollBar Class
! 
!    The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
! 
!    Requirements:
!       dynapi.api.*
!       dynapi.util [thread, pathanim]
!       dynapi.gui [dynimage]
! */
! 
! // to do: add support for no images
! 
! function ScrollBar(orientation,bUseImages) {
!       this.DynLayer = DynLayer;
!       this.DynLayer();
!       
!       this.knob = this.addChild(new DynLayer());
! 
!       this.dragEvents = new EventListener(this);
!       this.dragEvents.ondragmove = function (e) {
!               var o = e.getTarget();
!               o.findRatio();
!               o.invokeEvent("scroll");
!               e.setBubble(false);
!       };
!       this.dragEvents.ondragstart = function (e) {
!               var o = e.getTarget();
!               e.setBubble(false);
!       };
!       this.dragEvents.ondragend = function (e) {
!               var o = e.getTarget();
!               e.setBubble(false);
!       };
!       DragEvent.setDragBoundary(this.knob);
!       DragEvent.enableDragEvents(this.knob);
!       
!       this.knob.addEventListener(this.dragEvents);
!               
!       this.mouseEvents = new EventListener(this);
!       this.mouseEvents.onmousemove = function(e) {
!               var knob = e.getTarget().knob;
!               if (knob.pathanim && knob.pathanim.playing) e.setBubble(false);
!       };
!       this.mouseEvents.onmousedown = function(e) {
!               var lyr = e.getSource();
!               var o = e.getTarget();
!               if (!lyr.pathanim || !lyr.pathanim.playing) {
!                       var newx = e.getX()-Math.ceil(o.knob.w/2);
!                       var newy = e.getY()-Math.ceil(o.knob.h/2);
!                       var offW = o.getWidth()-o.knob.w;
!                       var offH = o.getHeight()-o.knob.h;
!                       if (newx<0) newx=0;
!                       if (newx>=offW) newx=offW;
!                       if (newy<0) newy=0;
!                       if (newy>=offH) newy=offH;
!                       
!                       o.knob.slideTo(newx,newy);
!               }
!               e.setBubble(false);
!       };
!       this.mouseEvents.onmouseup = function(e) {
!               e.getTarget().knob.stopSlide();
!       };
!       this.addEventListener(this.mouseEvents);
!       
!       var slideEvents = new EventListener(this);
!       slideEvents.onpathrun = function(e) {
!               var o = e.getTarget();
!               o.findRatio();
!               o.invokeEvent("scroll");
!       };
!       slideEvents.onpathstop = function(e) {
!               var lyr = e.getSource();
!               var o = e.getTarget();
!               var evt = new MouseEvent();
!               evt.bubble = false;
!               evt.type = "mousedown";
!               evt.src = lyr;
!               evt.x = o.knob.getWidth()/2;
!               evt.y = o.knob.getHeight()/2;
!               evt.pageX = o.knob.getPageX()+evt.x;
!               evt.pageY = o.knob.getPageY()+evt.y;
!               lyr.invokeEvent("mousedown",evt);
!       };
!       this.knob.addEventListener(slideEvents);
!       
!       var resizeEvents = new EventListener(this);
!       resizeEvents.onresize = function(e) {
!               var o = e.getTarget();
!               if (o.getWidth()>0 && o.knob.x+o.knob.w>o.getWidth()) 
o.knob.setX(o.getWidth()-o.knob.w);
!               if (o.getHeight()>0 && o.knob.y+o.knob.h>o.getHeight()) 
o.knob.setY(o.getHeight()-o.knob.h);
!               o.findRatio();
!       };
!       this.addEventListener(resizeEvents);
!       
!       this.setOrientation(orientation);
!       if (bUseImages!=false) this.setTheme(MetalScrollBar());
! };
! 
! ScrollBar.prototype = new DynLayer;
! 
! ScrollBar.prototype.ratiox = 0;
! ScrollBar.prototype.ratioy = 0;
! 
! ScrollBar.prototype.setOrientation = function(type) { // 0=horz,1=vert
!       this.horizontal = (type==ScrollBar.HORIZONTAL);
!       this.vertical = (type==ScrollBar.VERTICAL);
! };
! ScrollBar.prototype.setTheme = function(theme) {
!       if (!theme) return;
!       if (this.horizontal) this.setImages(theme.htrough, theme.hknob);
!       else if (this.vertical) this.setImages(theme.vtrough, theme.vknob);
! }
! ScrollBar.prototype.setImages = function(troughImage,knobImage) {
!       if (troughImage) {
!               this.troughImage = troughImage;
!               this.setBgImage(this.troughImage.src);
!               if (this.vertical) this.setWidth(this.troughImage.width,false);
!               if (this.horizontal) this.setHeight(this.troughImage.height,false);
!       }
!       if (knobImage) {
!               this.knobImage = knobImage;
!               this.knob.setBgImage(this.knobImage.src);
!               this.knob.setSize(this.knobImage.width,this.knobImage.height);
!       }
!       this.hasImages = true;
! };
! ScrollBar.prototype.setRatio = function(rx,ry) {
!       this.setRatioX(rx);
!       this.setRatioY(ry);
! };
! ScrollBar.prototype.setRatioX = function(rx) {
!       this.knob.setX(Math.floor(rx*(this.getWidth()-this.knob.getWidth())));
! };
! ScrollBar.prototype.setRatioY = function(ry) {
!       this.knob.setY(Math.floor(ry*(this.getHeight()-this.knob.getHeight())));
! };
! ScrollBar.prototype.getRatioX = function() {
!       return this.ratiox;
! };
! ScrollBar.prototype.getRatioY = function() {
!       return this.ratioy;
! };
! 
! ScrollBar.prototype.findRatio = function() {
!       var tx = (this.getWidth()-this.knob.w);
!       var ty = (this.getHeight()-this.knob.h);
!       this.ratiox = tx==0 ? 0 : (this.knob.x)/tx;
!       this.ratioy = ty==0 ? 0 : (this.knob.y)/ty;
! };
! ScrollBar.prototype.reset = function() { 
!       this.knob.moveTo(0,0); 
!       this.ratiox=this.ratioy=0;
! };
! ScrollBar.VERTICAL = 1;
! ScrollBar.HORIZONTAL = 2;
! 
! function MetalScrollBar () {
!       if (!DynAPI.librarypath) return null;
!       return {
!               vtrough : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-vbg.gif',16,16),
!               vknob : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-vknob.gif',16,37),
!               htrough : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-hbg.gif',16,16),
!               hknob : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-hknob.gif',37,16)
!       }
  }
--- 1,168 ----
! /*
!    DynAPI Distribution
!    ScrollBar Class
! 
!    The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
! 
!    Requirements:
!       dynapi.api.*
!       dynapi.util [thread, pathanim]
!       dynapi.gui [dynimage]
! */
! 
! // to do: add support for no images
! 
! function ScrollBar(orientation,bUseImages) {
!       this.DynLayer = DynLayer;
!       this.DynLayer();
!       
!       this.knob = this.addChild(new DynLayer());
! 
!       this.dragEvents = new EventListener(this);
!       this.dragEvents.ondragmove = function (e) {
!               var o = e.getTarget();
!               o.findRatio();
!               o.invokeEvent("scroll");
!               e.setBubble(false);
!       };
!       this.dragEvents.ondragstart = function (e) {
!               var o = e.getTarget();
!               e.setBubble(false);
!       };
!       this.dragEvents.ondragend = function (e) {
!               var o = e.getTarget();
!               e.setBubble(false);
!       };
!       DragEvent.setDragBoundary(this.knob);
!       DragEvent.enableDragEvents(this.knob);
!       
!       this.knob.addEventListener(this.dragEvents);
!               
!       this.mouseEvents = new EventListener(this);
!       this.mouseEvents.onmousemove = function(e) {
!               var knob = e.getTarget().knob;
!               if (knob.pathanim && knob.pathanim.playing) e.setBubble(false);
!       };
!       this.mouseEvents.onmousedown = function(e) {
!               var lyr = e.getSource();
!               var o = e.getTarget();
!               if (!lyr.pathanim || !lyr.pathanim.playing) {
!                       var newx = e.getX()-Math.ceil(o.knob.w/2);
!                       var newy = e.getY()-Math.ceil(o.knob.h/2);
!                       var offW = o.getWidth()-o.knob.w;
!                       var offH = o.getHeight()-o.knob.h;
!                       if (newx<0) newx=0;
!                       if (newx>=offW) newx=offW;
!                       if (newy<0) newy=0;
!                       if (newy>=offH) newy=offH;
!                       
!                       o.knob.slideTo(newx,newy);
!               }
!               e.setBubble(false);
!       };
!       this.mouseEvents.onmouseup = function(e) {
!               e.getTarget().knob.stopSlide();
!       };
!       this.addEventListener(this.mouseEvents);
!       
!       var slideEvents = new EventListener(this);
!       slideEvents.onpathrun = function(e) {
!               var o = e.getTarget();
!               o.findRatio();
!               o.invokeEvent("scroll");
!       };
!       slideEvents.onpathstop = function(e) {
!               var lyr = e.getSource();
!               var o = e.getTarget();
!               var evt = new MouseEvent();
!               evt.bubble = false;
!               evt.type = "mousedown";
!               evt.src = lyr;
!               evt.x = o.knob.getWidth()/2;
!               evt.y = o.knob.getHeight()/2;
!               evt.pageX = o.knob.getPageX()+evt.x;
!               evt.pageY = o.knob.getPageY()+evt.y;
!               lyr.invokeEvent("mousedown",evt);
!       };
!       this.knob.addEventListener(slideEvents);
!       
!       var resizeEvents = new EventListener(this);
!       resizeEvents.onresize = function(e) {
!               var o = e.getTarget();
!               if (o.getWidth()>0 && o.knob.x+o.knob.w>o.getWidth()) 
o.knob.setX(o.getWidth()-o.knob.w);
!               if (o.getHeight()>0 && o.knob.y+o.knob.h>o.getHeight()) 
o.knob.setY(o.getHeight()-o.knob.h);
!               o.findRatio();
!       };
!       this.addEventListener(resizeEvents);
!       
!       this.setOrientation(orientation);
!       if (bUseImages!=false) this.setTheme(MetalScrollBar());
! };
! 
! ScrollBar.prototype = new DynLayer;
! 
! ScrollBar.prototype.ratiox = 0;
! ScrollBar.prototype.ratioy = 0;
! 
! ScrollBar.prototype.setOrientation = function(type) { // 0=horz,1=vert
!       this.horizontal = (type==ScrollBar.HORIZONTAL);
!       this.vertical = (type==ScrollBar.VERTICAL);
! };
! ScrollBar.prototype.setTheme = function(theme) {
!       if (!theme) return;
!       if (this.horizontal) this.setImages(theme.htrough, theme.hknob);
!       else if (this.vertical) this.setImages(theme.vtrough, theme.vknob);
! }
! ScrollBar.prototype.setImages = function(troughImage,knobImage) {
!       if (troughImage) {
!               this.troughImage = troughImage;
!               this.setBgImage(this.troughImage.src);
!               if (this.vertical) this.setWidth(this.troughImage.width,false);
!               if (this.horizontal) this.setHeight(this.troughImage.height,false);
!       }
!       if (knobImage) {
!               this.knobImage = knobImage;
!               this.knob.setBgImage(this.knobImage.src);
!               this.knob.setSize(this.knobImage.width,this.knobImage.height);
!       }
!       this.hasImages = true;
! };
! ScrollBar.prototype.setRatio = function(rx,ry) {
!       this.setRatioX(rx);
!       this.setRatioY(ry);
! };
! ScrollBar.prototype.setRatioX = function(rx) {
!       this.knob.setX(Math.floor(rx*(this.getWidth()-this.knob.getWidth())));
! };
! ScrollBar.prototype.setRatioY = function(ry) {
!       this.knob.setY(Math.floor(ry*(this.getHeight()-this.knob.getHeight())));
! };
! ScrollBar.prototype.getRatioX = function() {
!       return this.ratiox;
! };
! ScrollBar.prototype.getRatioY = function() {
!       return this.ratioy;
! };
! 
! ScrollBar.prototype.findRatio = function() {
!       var tx = (this.getWidth()-this.knob.w);
!       var ty = (this.getHeight()-this.knob.h);
!       this.ratiox = tx==0 ? 0 : (this.knob.x)/tx;
!       this.ratioy = ty==0 ? 0 : (this.knob.y)/ty;
! };
! ScrollBar.prototype.reset = function() { 
!       this.knob.moveTo(0,0); 
!       this.ratiox=this.ratioy=0;
! };
! ScrollBar.VERTICAL = 1;
! ScrollBar.HORIZONTAL = 2;
! 
! function MetalScrollBar () {
!       if (!DynAPI.librarypath) return null;
!       return {
!               vtrough : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-vbg.gif',16,16),
!               vknob : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-vknob.gif',16,37),
!               htrough : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-hbg.gif',16,16),
!               hknob : 
DynImage.getImage(DynAPI.librarypath+'dynapi/images/scrollpane/scrollbar-hknob.gif',37,16)
!       }
  }

--- .jspack DELETED ---


_______________________________________________
Dynapi-CVS mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-cvs

Reply via email to