tags:

views:

812

answers:

2

I have a window, the window I programmatically change the size of the window depending on the current view it is displaying. The user cannot resize the window them self, but they can maximize the window.

The problem is if the view is changed while it is maximized, the maximized window size changes, I do not want this, I want it to only change the size of the non-maximized window.

My first thought is to just check if the window is maximized, and if so do not resize it...but the issue there is then when it is restored at a different view then when it was maximized it will not restore to the new size it should be.

Any thoughts on this?

Thanks!

A: 

Well, I tried many things and none seemed to work accurately. So for now I just made it impossible to change the view/state while maximized. Kinda lame but it keeps it from performing incorrectly.

John Isaacks
This isn't an answer to this question it is simply avoiding the issue.
Ryan H
A: 

Have two states, maximized and normal. In the maximized state, set the width and height to the standard maximums. In the normal state set them to some variables you have stored with the current normal width and height. In other words, when the size is changed, don't automatically set the width and height unless currently in normal mode. Save the new normal width and height in variables called normalWidth and normalHeight.

You states might look like this

<mx:States>
<mx:State name="normal">
    <mx:SetProperty name="width" value="{normalWidth}"/>
    <mx:SetProperty name="height" value="{normalHeight}"/>        
</mx:State>
<mx:State name="maximized">
    <mx:SetProperty name="width" value="{MAX_WIDTH}"/>
    <mx:SetProperty name="height" value="{MAX_HEIGHT}"/>        
</mx:State>
</mx:States>
Sean Clark Hess