PxPlus User Forum

Twitter Twitter Twitter

Author Topic: MS Window Size  (Read 2192 times)

Skip.Dahl

  • Member
  • **
  • Posts: 17
    • View Profile
MS Window Size
« on: June 28, 2021, 03:46:57 PM »
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

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: MS Window Size
« Reply #1 on: June 29, 2021, 10:42:31 AM »
Try adding a

CALL "*winpnl"

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

Skip.Dahl

  • Member
  • **
  • Posts: 17
    • View Profile
Re: MS Window Size
« Reply #2 on: June 29, 2021, 04:18:44 PM »
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

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: MS Window Size
« Reply #3 on: June 29, 2021, 05:59:05 PM »
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.

Code: [Select]
  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

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: MS Window Size
« Reply #4 on: June 30, 2021, 03:37:19 AM »
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

  • Member
  • **
  • Posts: 17
    • View Profile
Re: MS Window Size
« Reply #5 on: June 30, 2021, 08:38:55 AM »
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

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: MS Window Size
« Reply #6 on: June 30, 2021, 09:46:11 AM »
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

  • Diamond Member
  • *****
  • Posts: 122
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: MS Window Size
« Reply #7 on: July 05, 2021, 03:06:11 AM »
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