MS Window Size

Started by Skip.Dahl, June 28, 2021, 03:46:57 PM

Previous topic - Next topic

Skip.Dahl

How do I keep the application window size of pxplus static when a user restarts the program? It resets to default size rather than remembering what the user had previously dragged it to.



Mike King

Try adding a

CALL "*winpnl"

to your START_UP program.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Skip.Dahl

I added the call *winpnl within the startup program and PVX still opens in
a smaller window.   Not sure if any of this makes a difference but
ProvideX is on a Linux server running a character based software.
attached is a screen shot of the initial window.


Mike King

The call to *winpnl is designed to save/recall window sizes for Nomads -- the graphical environment -- which is what we assumed since you are running WindX.

For Text mode the issue is the PxPlus container which when PxPlus first came out was intended to be a container for your windows thus its size is controlled by the user, however the following logic can be used to adjust it.

  read data from fin(0,"XYPOS"),sep="," to X,Y,WD,HI
  read data from fin(0,"XYCLIENT"),sep="," to CHILDWD,CHILDHI
  X$=str(X)+","+str(Y)+","+str(X+CHILDWD+16)+","+str(Y+CHILDHI+110)
  print 'option'("XYRECT",X$),


Now those value +16 and +110 are somewhat arbitrary but work for Windows 10 which includes the shadow of the window in the actual window size.  There is an API call you can use to get the exact value but for simplicity I would use these.

Put this code in the start of your application and the system should set the outer window frame to match the inner frame and its font size.

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Thomas Bock

We use the parameter "-hd" when starting a new PxPlus process. For CUI sessions we omit it, which makes PxPlus save the location and size in the pvx.ini for later use.

Skip.Dahl

One thing I found out late yesterday was that some users once they initially
drag their window size out then later exit, next time in it was saved to
what they had sized their window at.   But not others, each time in they
have to resize their window.  It had been working on the older version of WindX
just now happening since upgrading.

Thomas Bock

I can remember a similar behavior a long time ago. As far as I can recall the solution was to make sure each user use his/her own pvx.ini. Otherwise the last one wins. Use "%userprofile%\pvx.ini" when spawning the new process.

Stéphane Devouard

Hi


Could also be due to the location where WindX has been installed on each workstation.
If it is installed under "Program Files", the Windows security enforced on this system directory may prevent the interpreter from writing back to pvx.ini / pxplus.ini when exiting


Regards,
Stéphane Devouard
Portfolio | Work