states-$6.lzx
<canvas width="100%">
<window title="state demo" width="400" height="300" oninit="this.max.setAttribute('applied', true)">
<state name="max">
<animatorgroup duration="1000" process="simultaneous">
<animator attribute="width" to="400"/>
<animator attribute="height" to="300"/>
<animator attribute="x" to="100"/>
<animator attribute="y" to="100"/>
</animatorgroup>
<text align="center" y="20%">M a x i m i z e d</text>
</state>
<state name="min">
<animatorgroup duration="1000" process="simultaneous">
<animator attribute="width" to="170"/>
<animator attribute="height" to="100"/>
<animator attribute="x" to="0"/>
<animator attribute="y" to="0"/>
</animatorgroup>
<text align="center" valign="middle">Minimized</text>
</state>
<button placement="title_area" align="right" height="16"> Toggle
<attribute name="isMax" value="true
"/>
<handler name="onclick">
if (this.isMax) {parent.max.setAttribute('applied', false); parent.min.setAttribute('applied', true);}
else {parent.max.setAttribute('applied', true); parent.min.setAttribute('applied', false);}
this.isMax = !this.isMax;
</handler>
</button>
</window>
</canvas>
Cross References