Update of /cvsroot/dynapi/dynapi3x/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv6593/src/gui
Modified Files:
imageclip.js
Added Files:
focusmanager.js
Log Message:
updated/added by raymond
--- NEW FILE ---
/*
DynAPI Distribution
CircleAnimation Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
requires: DynLayer
*/
FocusManager={};
// usage: FocusManager.enableFocus('auto',true,'click',lyr1,lyr2,...lyrN);
FocusManager.enableFocus=function(b,bubble,type){
var lyr,arg=arguments;
for (var i=3;i<arg.length;i++){
lyr=arg[i];
if(lyr) lyr.setFocus(b,bubbbble,tyep);
}
};
DynLayer.prototype.setFocus = function(b,bubble,type){
var i,topchild;
var d=this.design;
bubble=(bubble==null)? true:bubble;
if(b!=='auto' && !this.parent) return;
if(b=='auto' && !this._hasFocusEvents) {
if(type!='hover') type='click';
this._focusType=type;
this._focusBubble=bubble;
this._hasFocusEvents=true;
this.addEventListener(DynLayer.FocusEvent);
}
else if (b && !this._focused) {
topchild=this.parent._topMostChild;
i = this.parent.children.length;
if(topchild && topchild!=this) topchild.setFocus(false,bubble);
this.setZIndex({topmost:true});
this.parent._topMostChild=this;
this._focused=true;
this.invokeEvent('focus');
var o=this.parent;
if(bubble) while (o && o!=dynapi.document) {
o.setFocus(b,bubble);
o=o.parent;
};
}else if(!b && this._focused){
topchild=this.parent._topMostChild;
if (topchild) this.setZIndex({below:topchild});
else this.setZIndex(thiz.z-1);
this._focused=false;
this.invokeEvent('blur');
var o=this.parent;
var ch=this.children;
// blur children with focus
for(var i=0;i<ch.length;i++) if(ch[i]._focused) ch[i].setFocus(false,bubble);
if(o && o!=dynapi.document) o.setFocus(false,bubble);
}
};
DynLayer.prototype.setTabIndex = function(n){
};
DynLayer.FocusEvent = {
onclick : function(e){
var o=e.getSource();
if(o._focusType=='click') {
o.setFocus(true,o._focusBubble);
}
},
onmouseover : function(e){
var o=e.getSource();
if(o._focusType=='hover') {
o.setFocus(true,o._focusBubble);
}
}
};
Index: imageclip.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi3x/src/gui/imageclip.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** imageclip.js 9 Mar 2003 22:19:59 -0000 1.1
--- imageclip.js 26 Mar 2003 02:22:31 -0000 1.2
***************
*** 54,58 ****
if(!clipImage) return;
this._clipImage=clipImage;
! clipImage = (clipImage.getHTML)? clipImage.getHTML():'<img height='+this.lyrCanvas.h+' width='+this.lyrCanvas.w+' border=0 src="'+((clipimage.src)? clipimage.src:clipimage)+'">';
this.setupFrames(cols,rows);
this.lyrCanvas.setHTML(clipImage);
--- 54,58 ----
if(!clipImage) return;
this._clipImage=clipImage;
! clipImage = (clipImage.getHTML)? clipImage.getHTML():'<img height='+this.lyrCanvas.h+' width='+this.lyrCanvas.w+' border=0 src="'+((clipImage.src)? clipImage.src:clipImage)+'">';
this.setupFrames(cols,rows);
this.lyrCanvas.setHTML(clipImage);
|