Update of /cvsroot/dynapi/dynapi/src/lib/dynapi/api
In directory usw-pr-cvs1:/tmp/cvs-serv16386
Modified Files:
dynlayer.js
Log Message:
SetSize does not call setWidth, setHeight anymore. Reasons: 1) performance and most
important 2) if setSize calls setWidth and you have a widget that overwrites setWidth
to do something and call its setSize ( it happened to me ), you call to setSize causes
the layr's setSize to be executed, and this causes a seiWidth call, which executes the
overwriten method in the widget, which executes de layer's setSize, which executes
setWidth.... giving you a very nice infinite loop, stack overflows, etc,etc,etc ...
Index: dynlayer.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/api/dynlayer.js,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** dynlayer.js 2001/03/28 11:48:15 1.40
--- dynlayer.js 2001/03/28 18:19:40 1.41
***************
*** 315,321 ****
};
DynLayer.prototype.setSize = function(w,h,noevt) {
! if (w!=null) this.setWidth(w,false);
! if (h!=null) this.setHeight(h,false);
! if (noevt!=false) this.invokeEvent('resize');
};
DynLayer.prototype.setWidth=function(w,noevt) {
--- 315,334 ----
};
DynLayer.prototype.setSize = function(w,h,noevt) {
! this.w=(w==null)?this.w:w<0?0:w;
! if (this.w==null) return;
! this.h=(h==null)?this.h:h<0?0:h;
! if (this.h==null) return;
! if (this.css!=null) {
! if (is.ns4) {
! this.css.clip.width = this.w;
! this.css.clip.height = this.h;
! }
! else {
! this.css.width = this.w;
! this.css.height = this.h;
! this.css.clip = 'rect(0px '+(this.w||0)+'px '+(this.h||0)+'px
0px)';
! }
! }
! if (noevt!=false) this.invokeEvent('resize');
};
DynLayer.prototype.setWidth=function(w,noevt) {
_______________________________________________
Dynapi-CVS mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-cvs