Re: SplitPaneWidget height
Christian Boulanger <[email protected]> Wed, 04 Aug 2004 20:19:52 +0200
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <[email protected]> |
> It should already attach itself to the parent item's resize handler
> and attempt to re-calculate its size. If this isn't working for you,
> let me know.
Somehow, it doesn't. But what I did is the following:
<div id="mainDiv"
style="width: 100%; height:400px">
<!-- resize this div -->
<script type="text/javascript">
resizeHeight("mainDiv",100);
</script>
<div nwtype="split_pane"
height="100%"
vertical="true"
firstpanesize="200"
dragbarwidth="5"
nwAppId="splitPane">
etc.
with the following dependencies.
// from http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=16
function windowSize() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement &&
( document.documentElement.clientWidth ||
document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth ||
document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
return({width:myWidth,height:myHeight});
}
function resizeHeight(nodeId,offset)
{
var newSize = (windowSize().height-offset)+"px";
document.getElementById(nodeId).style.height = newSize;
}
I am sure this could be more elegantly done with nW methods, but I
wouldn't know how. This doesn't dynamically resize, but at least adapts
to the chosen window size.
Best,
Christian
_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org