Page 1 of 1

Restoring a minimized window?

PostPosted: Tue Dec 27, 2016 2:18 am
by joe26
Is there a way to programmatically raise a minimized window in the smart client?

I've been using win.toFront() but haven't found a way to show it again, once it is minimized by the user.

thanks!
--Joe.

Servoy 7.4.8

Re: Restoring a minimized window?

PostPosted: Tue Dec 27, 2016 8:06 pm
by kwpsd
Well, you could try:

Code: Select all
plugins.window.maximize()


Although, I just posted that it is not working in 8.1.1. Also, read the wiki the window plugin for more info on how to use this function.

See http://forum.servoy.com/viewtopic.php?f=2&t=21560

I hope this helps!

Re: Restoring a minimized window?

PostPosted: Wed Dec 28, 2016 10:24 pm
by joe26
Thank you, Kim, but it isn't working for me in 7.4.8 either. Cannot say whether it has ever worked, because I rarely minimize windows.

plugins.window.maximize(windowx.title);
plugins.window.maximize(windowName);
windowx.toFront();

If the window is not minimized, toFront() works fine.

If the window is not minimized, maximize just doesn't work.

I've located references to the Java status setting but really not interested in building a bean right now...

minimize with frame.setState(Frame.ICONIFIED)
restore with frame.setState(Frame.NORMAL)

--Joe.

Workaround

PostPosted: Mon Jan 02, 2017 11:37 am
by Bernd.N
Maybe a workaround helps?
However I did not try this before posting:

Code: Select all
var
   wWindow = application.getWindow(sWindowName),
   iScreenHeight = application.getScreenHeight(),
   iScreenWidth = application.getScreenWidth();

wWindow.setSize(iScreenWidth, iScreenHeight);

Re: Restoring a minimized window?

PostPosted: Mon Jan 02, 2017 9:32 pm
by joe26
I've already tried the window.maximize(), and it maximizes if I click on the minimized window.

Otherwise, it fails silently.

I may try the bounds, but thankfully I can ignore this action for a bit. Seems like a crippling bug, imho.

The only workaround that I can come up with is open the view in a NEW window, if I somehow sense the user it getting frustrated by a count of an onAction that they keep pushing the button to active the window. Seems like a screwed up workaround and wasteful of resources, but there it is.

Thanks!
--Joe.

Re: Restoring a minimized window?

PostPosted: Tue Jan 17, 2017 8:47 pm
by joe26
Bernd,

I wasn't successful recalling a minimized window with setting window bounds. It certainly changes the bounds of the window, but does not un-minimize the window.

Attempted to sneak it toBack() and then toFront(), which was also unsuccessful.

I guess if I get multiple requests for the window, a the form can be opened in a new window which is usually visible.

Thanks again!
--Joe.

Re: Restoring a minimized window?

PostPosted: Tue Feb 14, 2017 7:14 pm
by joe26
Does anyone know which version of Servoy can raise a window from the minimized state?

Thanks!