From: Darin K. <dka...@ef...> - 2001-02-11 22:48:04
|
have I been wrong in just doing it like this? DynAPI.onResize=function(){WebBrowser1.moveToImage('browserImage')} what would be the consequences? -----Original Message----- From: Michael Pemberton To: dyn...@li... Sent: 2/11/01 2:20 PM Subject: Re: [Dynapi-Dev] DynAPI resizeHandler I think that your changes should be added to the API by one of the admins. I'm surprised no one has mentioned of it earlier. : ) David Holbrook wrote: > I have been trying to make a Layer that would resize as the browser window > resizes... I tried something like this without much luck: > > DynAPI.onLoad = function() { > > var pad = 10; > > myLayer = new DynLayer(); > > myLayer.setSize(DynAPI.document.getWidth()-(pad*2),DynAPI.document.getHe ight > ()-(pad*2)); > myLayer.setBgColor('#c0c0c0'); > myLayer.moveTo(pad,pad); > > rszLstn=new EventListener(myLayer); > rszLstn.onresize=function(e) { > target = e.getTarget(); > > target.setSize(target.parent.getWidth()-(pad*2),target.parent.getHeight( )-(p > ad*2)); > } > DynAPI.document.addEventListener(rszLstn); > > DynAPI.document.addChild(myLayer); > > } > > It didn't seem that there was a resize event in the document... I took a > look at the resizeHandler and also the loadHandler and noticed the load > handler was invoking a beforeload, load, and afterload event. I borrowed > the event code from the loadHandler and add this line to the resizeHandler: > > if (DynAPI.document.invokeEvent) DynAPI.document.invokeEvent('resize'); > > ..and my code worked like I expected it to. > > I have two questions. > 1) What would be the "normal" way of doing this without modifying the > DynAPI. > 2) Should the resize event be added to the resize handler for convenience > and consistency. > > Thanks > Dave Holbrook > dav...@ho... > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev _______________________________________________ Dynapi-Dev mailing list Dyn...@li... http://lists.sourceforge.net/lists/listinfo/dynapi-dev |
From: Michael P. <mp...@ph...> - 2001-02-11 23:07:50
|
it is better to do it using resize handlers. this way, you can use a single handler to deal with the resize event on frames other than the one that contains the main api code. Darin Kadrioski wrote: > > have I been wrong in just doing it like this? > > DynAPI.onResize=function(){WebBrowser1.moveToImage('browserImage')} > > what would be the consequences? > > -----Original Message----- > From: Michael Pemberton > To: dyn...@li... > Sent: 2/11/01 2:20 PM > Subject: Re: [Dynapi-Dev] DynAPI resizeHandler > > I think that your changes should be added to the API by one of the > admins. I'm > surprised no one has mentioned of it earlier. : ) > > David Holbrook wrote: > > > I have been trying to make a Layer that would resize as the browser > window > > resizes... I tried something like this without much luck: > > > > DynAPI.onLoad = function() { > > > > var pad = 10; > > > > myLayer = new DynLayer(); > > > > > myLayer.setSize(DynAPI.document.getWidth()-(pad*2),DynAPI.document.getHe > ight > > ()-(pad*2)); > > myLayer.setBgColor('#c0c0c0'); > > myLayer.moveTo(pad,pad); > > > > rszLstn=new EventListener(myLayer); > > rszLstn.onresize=function(e) { > > target = e.getTarget(); > > > > > target.setSize(target.parent.getWidth()-(pad*2),target.parent.getHeight( > )-(p > > ad*2)); > > } > > DynAPI.document.addEventListener(rszLstn); > > > > DynAPI.document.addChild(myLayer); > > > > } > > > > It didn't seem that there was a resize event in the document... I > took a > > look at the resizeHandler and also the loadHandler and noticed the > load > > handler was invoking a beforeload, load, and afterload event. I > borrowed > > the event code from the loadHandler and add this line to the > resizeHandler: > > > > if (DynAPI.document.invokeEvent) > DynAPI.document.invokeEvent('resize'); > > > > ..and my code worked like I expected it to. > > > > I have two questions. > > 1) What would be the "normal" way of doing this without modifying the > > DynAPI. > > 2) Should the resize event be added to the resize handler for > convenience > > and consistency. > > > > Thanks > > Dave Holbrook > > dav...@ho... > > > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev -- Michael Pemberton mp...@ph... ICQ: 12107010 |