Update of /cvsroot/dynapi/dynapi/src/lib/dynapi/gui
In directory usw-pr-cvs1:/tmp/cvs-serv30539
Modified Files:
dynimage.js
Log Message:
Some fixes, but still doesnt seem to work right
Index: dynimage.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/gui/dynimage.js,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** dynimage.js 2001/03/25 06:04:16 1.17
--- dynimage.js 2001/03/26 02:42:14 1.18
***************
*** 11,24 ****
function DynImage() {
this.DynLayer = DynLayer;
! this.DynLayer();
!
! if (typeof(arguments[0])=="string") this.setImageSrc(arguments[0]); //
DynImage("source")
! else if (typeof(arguments[0])=="object") this.setImage(arguments[0]); //
DynImage(imgObj)
else this.img = null;
-
this.addEventListener(DynImage.listener);
};
DynImage.prototype = new DynLayer;
-
DynImage.listener = new EventListener();
DynImage.listener.onprecreate = function(e) {
--- 11,21 ----
function DynImage() {
this.DynLayer = DynLayer;
! this.DynLayer();
! if (typeof(arguments[0])=="string") this.setImageSrc(arguments[0]);
! else if (typeof(arguments[0])=="object") this.setImage(arguments[0]);
else this.img = null;
this.addEventListener(DynImage.listener);
};
DynImage.prototype = new DynLayer;
DynImage.listener = new EventListener();
DynImage.listener.onprecreate = function(e) {
***************
*** 36,49 ****
}
};
-
- // this is an optional method that only effects the behaviour on subsequent image
changes.
- // During the first creation of DynImage if no w/h is set it will automatically
resize
- // during creation regardless of whether this value is set or not (that is a
function of the DynLayer).
- // If you setAutoResize(true) when you change images after creation it will resize
itself again.
DynImage.prototype.setAutoResize = function (b) {
this.autoResize = b;
if (this.created) this.setImage(this.img);
};
-
DynImage.prototype.setImage = function (imgObject,bRedraw) {
if (!imgObject) {
--- 33,40 ----
***************
*** 51,55 ****
}
this.img = imgObject;
!
if (this.created && this.autoResize && !bRedraw) {
if (this.img.width!=this.w && this.img.height!=this.h) {
--- 42,46 ----
}
this.img = imgObject;
! this.img.dynimage = this;
if (this.created && this.autoResize && !bRedraw) {
if (this.img.width!=this.w && this.img.height!=this.h) {
***************
*** 58,62 ****
}
}
-
if (!this.created || bRedraw) {
var wh = ((this.w!=null && this.h!=null)) ? ' width='+this.w+'
height='+this.h : '';
--- 49,52 ----
***************
*** 78,84 ****
return this.img? this.img.src : null;
};
!
! // Functions
!
DynImage.loadimages=[];
DynImage.getImage=function(src,w,h) {
--- 68,72 ----
return this.img? this.img.src : null;
};
! // Static Methods
DynImage.loadimages=[];
DynImage.getImage=function(src,w,h) {
***************
*** 92,95 ****
--- 80,85 ----
DynImage.loadimages[i].complete = false;
DynImage.loadimages[i].img.src=DynImage.loadimages[i].origsrc=src;
+ DynImage.loadimages[i].img.w=DynImage.loadimages[i].img.width;
+ DynImage.loadimages[i].img.h=DynImage.loadimages[i].img.height;
return DynImage.loadimages[i].img;
};
***************
*** 108,113 ****
else {
for (var i=0; i<DynImage.loadimages.length; i++) {
! if (DynImage.loadimages[i].img.dynimage &&
DynImage.loadimages[i].img.dynimage.imgresize) {
!
DynImage.loadimages[i].img.dynimage.setSize(DynImage.loadimages[i].img.w,DynImage.loadimages[i].img.h,true);
}
}
--- 98,103 ----
else {
for (var i=0; i<DynImage.loadimages.length; i++) {
! if (DynImage.loadimages[i].img.dynimage) {
!
DynImage.loadimages[i].img.dynimage.setSize(DynImage.loadimages[i].img.w,DynImage.loadimages[i].img.h,true)
}
}
***************
*** 115,117 ****
}
};
! DynAPI.addLoadFunction("DynImage.loaderStart()")
--- 105,107 ----
}
};
! DynAPI.addLoadFunction("DynImage.loaderStart()")
\ No newline at end of file
_______________________________________________
Dynapi-CVS mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-cvs