PDA

View Full Version : Window closes on resize


TripleToe
07-01-2004, 02:22 PM
I've created a window in my application. When I click on the resize handle in the lower right corner of the window, the window closes. Something in the definition of the window is causing this because I can create a very basic window right beside it that behaves correctly. Here is the code for the window that closes when you resize it:

...

<window name="session_window" title="Current Session" width="300" height="100" opacity="0.0"
closeable="true" resizable="true" x="${canvas.width+1}" y="${canvas.y-this.height}">
<attribute type="string" name="minmax" value="min"/>
<animatorgroup name="reveal_animator_group" process="simultaneous">
<animator attribute="y" to="${canvas.y+24}" duration="700" start="false"/>
<animator attribute="x" to="${canvas.width-299}" duration="700" start="false"/>
<animator attribute="opacity" to="1.0" duration="700" start="false"/>
</animatorgroup>
<animatorgroup name="suppress_animator_group" process="simultaneous">
<animator attribute="y" to="${canvas.y-100}" duration="700" start="false"/>
<animator attribute="x" to="${canvas.width+1}" duration="700" start="false"/>
<animator attribute="opacity" to="0.0" duration="700" start="false"/>
</animatorgroup>
<method name="trigger">
debug.write('session_window.trigger()');
debug.write('minmax=' + this.minmax);
if (this.minmax == "min")
{
debug.write('minmax is min');
this.reveal_animator_group.doStart();
this.minmax = "max";
}
else
{
debug.write('minmax is max');
this.suppress_animator_group.doStart();
this.minmax = "min";
}
</method>
<resizelayout axis="y"/>
<view width="${this.parent.width}" options="releasetolayout">
<resizelayout axis="x"/>
<text multiline="true" width="55">Status:</text>
<text multiline="true" datapath="session_status_dataset:/session/authentication_status/text()"
options="releasetolayout"/>
</view>
<view width="${this.parent.width}" options="releasetolayout">
<resizelayout axis="x"/>
<text multiline="true" width="55">User:</text>
<text multiline="true" datapath="session_status_dataset:/session/user/text()"
options="releasetolayout"/>
</view>
<view width="${this.parent.width}" options="releasetolayout">
<resizelayout axis="x"/>
<text multiline="true" width="55">Started:</text>
<text multiline="true" datapath="session_status_dataset:/session/session_start_time/text()"
options="releasetolayout"/>
</view>
</window>

....

A basic window behaves correctly so I guess I'm just overlooking something that in the above code block that is causing it to close instead of resize. Can anyone figure it out?

Thanks

antun
07-01-2004, 04:05 PM
It's the x- and y- constraints.


<window name="session_window" title="Current Session" width="300"
height="100" opacity="0.0"
closeable="true" resizable="true"
x="${canvas.width+1}" y="${canvas.y-this.height}">


The animators that move the window in the reveal_animator_group position the window in the right place. Then you start resizing the window, the constraint starts to fight with the position.

What I think you want is to have the constraint only happen at init time:


x="$once{canvas.width+1}"


-Antun

TripleToe
07-02-2004, 07:12 AM
Excellent! That explanation makes perfect sense now that I think about it. Thanks for the help.

:)