peejay
12-23-2006, 09:53 AM
Hi,
I am trying to create a window that can be resized but is constrained to some predetermined width and height. The code works great for the width but for some unknown reason I get weird results for the height.
Here's my code:
<canvas>
<class name="resizestatelohi" extends="state">
<attribute name="width"
value="${Math.min(Math.max(width, lowidth), hiwidth)}" />
<attribute name="height"
value="${Math.min(Math.max(height, loheight), hiheight)}" />
</class>
<window name="win01" allowdrag="false" resizable="true">
<attribute name="width" value="100"/>
<attribute name="height" value="200"/>
<attribute name="lowidth" value="100"/>
<attribute name="loheight" value="200"/>
<attribute name="hiwidth" value="500"/>
<attribute name="hiheight" value="400"/>
<resizestatelohi name="_resizestatelohi"/>
<handler name="onstate">
if (this.state == 5) {this._resizestatelohi.apply()}
else {this._resizestatelohi.remove()}
</handler>
</window>
</canvas>
Any ideas ?
TIA for all the help.
PJ
I am trying to create a window that can be resized but is constrained to some predetermined width and height. The code works great for the width but for some unknown reason I get weird results for the height.
Here's my code:
<canvas>
<class name="resizestatelohi" extends="state">
<attribute name="width"
value="${Math.min(Math.max(width, lowidth), hiwidth)}" />
<attribute name="height"
value="${Math.min(Math.max(height, loheight), hiheight)}" />
</class>
<window name="win01" allowdrag="false" resizable="true">
<attribute name="width" value="100"/>
<attribute name="height" value="200"/>
<attribute name="lowidth" value="100"/>
<attribute name="loheight" value="200"/>
<attribute name="hiwidth" value="500"/>
<attribute name="hiheight" value="400"/>
<resizestatelohi name="_resizestatelohi"/>
<handler name="onstate">
if (this.state == 5) {this._resizestatelohi.apply()}
else {this._resizestatelohi.remove()}
</handler>
</window>
</canvas>
Any ideas ?
TIA for all the help.
PJ