resizestatemin.lzx
<library>
<include href="utils/states/resizestate.lzx"/>
<class name="resizestatemin" extends="resizestate">
<attribute name="resize_min_width" value="0
" type="number"/>
<attribute name="resize_min_height" value="0
" type="number"/>
<attribute name="width" value="${Math.max((this.immediateparent.getMouse( 'x' )- __resize_xroffset), resize_min_width || 0)}"/>
<attribute name="height" value="${Math.max((this.immediateparent.getMouse( 'y' )- __resize_yroffset), resize_min_height || 0)}"/>
<doc>
<tag name="shortdesc"><text>Standard resizing behavior with a minimum width and height.</text></tag>
<text>
<p><classname>resizestatemin</classname> can be used to change the
width and height of a view in response to the movement of the
mouse.</p>
<p>Like <classname>resizestate</classname>,
<classname>resizestatemin</classname> tracks differences in the
mouse position from after it is applied, so the bottom right
corner of the resizing view <em>does not</em> snap to the
mouse position.</p>
<p>Note that the red box can not be resized to be smaller than the default minimum width and height of 0. The green box can only be resized to a minimum width of 100 and height of 50.</p>
<example title="Resizing a view to a minumum size using the mouse">
<canvas>
<simplelayout spacing="10"/>
<view bgcolor="red" width="200" height="200" onmousedown="this.res.setAttribute('applied', true)" onmouseup="this.res.setAttribute('applied', false)">
<resizestatemin name="res"/>
</view>
<view bgcolor="green" width="200" height="200" onmousedown="this.res.setAttribute('applied', true)" onmouseup="this.res.setAttribute('applied', false)">
<resizestatemin name="res" resize_min_width="${100}" resize_min_height="${50}"/>
</view>
</canvas>
</example>
</text>
</doc>
</class>
</library>
Cross References
Includes
Classes