<class name="two_buttons" extends="view">
<button name="minimizeBtn" height="100%" width="20" x="0" y="0"> _
<attribute name="isMax" value="true"/>
<method event="onclick">
if (this.isMax) {this.parent.parent.max.remove(); this.parent.parent.min.apply();}
else {this.parent.parent.max.apply(); this.parent.parent.min.remove();}
this.isMax = !this.isMax;
</method>
</button>
<button name="closeBtn" height="100%" width="20" x="25" y="0"> X
<attribute name="isClosed" value="false"/>
<method event="onclick">
this.parent.parent.setAttribute("visible", false);
</method>
</button>
</class>
<class name="fos_window" extends="window">
<attribute name="width" value="400" />
<attribute name="height" value="300" />
<state name="max" apply="true">
<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>
<two_buttons placement="title_area" align="right" height="100%"/>
</class>
<fos_window title="instance title"/>
</canvas>
Hi there, I simply took the exemple given in here http://www.laszlosystems.com/lps-3.2/docs/guide/states.html#d0e16592 (States chapter, thx Morgan);"Packaged" the two buttons as a class, using a view to get them together. If someone have a clue ? another method ?Thanks for help!<canvas>
<class name="two_buttons" extends="view">
<button name="minimizeBtn" height="100%" width="20"> _
<attribute name="isMax" value="true"/>
<method event="onclick">
if (this.isMax) {parent.max.remove(); parent.min.apply();}
else {parent.max.apply(); parent.min.remove();}
this.isMax = !this.isMax;
</method>
</button>
<button name="closeBtn" height="100%" width="20" > X
<attribute name="isClosed" value="false"/>
<method event="onclick">
this.parent.setAttribute("visible", false);
</method>
</button>
</class>
<class name="fos_window" extends="window">
<attribute name="width" value="400" />
<attribute name="height" value="300" />
<state name="max" apply="true">
<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>
<two_buttons placement="title_area" align="right"/>
</class><fos_window title="instance title"/>
</canvas>
_______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
