VLF-ONE Keep Window Size across Sessions

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLF-ONE Keep Window Size across Sessions

Post by jyoung »

I have a request from a user that they would like to keep the window size across sessions.

He goes to a window and initially it takes up half the workspace, so he maximizes it. Then when he logs out, logs back in and comes back to the window, it has reverted to the original half size. He is asking me to keep it maximized.

My thought is to detect when the window is maximized, write a flag to local storage. On initialize, check the local storage flag and use avPaneMaximize to maximize the window. The problem as I see it is that I don't have a way to detect when the panel has been maximized. We have the SizeChanged event, which lets me know that the size has changed, but not to what extent, i.e. maximized, minimized, etc.

Any thoughts on how I could detect when a panel has been maximized or to how to keep the panel size across sessions?
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE Keep Window Size across Sessions

Post by MarkD »

#COM_OWNER.AssociatedVF_AC025O.VF_AC005Container.CurrentState should get you the current panel state as NORMAL, MINIMUM, MAXIMUM

Maybe you don’t need to know when the panel size changes so much as whether it is maximized when the panel is being closed? Then you know what to do when it is reopened again later.

In your uTerminate method you might be able to use #COM_OWNER.AssociatedVF_AC025O.VF_AC005Container.CurrentState = MAXIMUM to store a “maximize on reopening” boolean.

VLF, including VLF-ONE, has local storage abstraction called the virtual clipboard - https://docs.lansa.com/14/en/lansa048/i ... _0840.htm

Regarding maximizing on reopening, in you uInitialize method I guess, I’d be inclined to delay that on a short timer to let all the initialization stuff settle down first.
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE Keep Window Size across Sessions

Post by MarkD »

BTW – VLF-ONE applications by default remember and restore panel sizes.
It’s just that it does not save the panel size when the state is MAXIMUM or MINIUM.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE Keep Window Size across Sessions

Post by jyoung »

Hey Mark,
BTW – VLF-ONE applications by default remember and restore panel sizes.
It’s just that it does not save the panel size when the state is MAXIMUM or MINIUM.
So when its maximized it does not save the state, but if I drag the window to a specific size it does.

That should resolve my user's issue, if not I will look into the CurrentState property you mentioned.

Thanks,
Joe
Post Reply