PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: Peter.Higgins on May 23, 2019, 04:33:51 PM

Title: Accommodate different monitor sizes
Post by: Peter.Higgins on May 23, 2019, 04:33:51 PM
Trying to make  panels relatively the same size on different monitors.

After obtaining the monitor DPI and calculating the new default graphic and text fonts
it looks like I need to drop and reinstantiate or init() the *obj/nomads.pvc object.
That's where nomads instantiation gets murky.

Does the font have any affect on character size?
Will I also have to set other fields like the Xchar, YChar, Xmax, Ymax? 

Title: Re: Accommodate different monitor sizes
Post by: James Zukowski on May 23, 2019, 05:16:22 PM
There's an easier way, as we are doing something that requires the same sort of recalculation of the font size world.

Use the 'option'() mnemonic to change the "StdFont" for the current PC. You may also need to change the 'font'() and set new values for your 'GF' and/or 'DF'.

Some Nomads variables to check are:
To prevent too much flickering, you may want to position the current window WAY off the screen with 'option'("XYPos",...), do the changes, and then reposition it back to where you want it.
Title: Re: Accommodate different monitor sizes
Post by: Peter.Higgins on May 24, 2019, 08:26:20 AM
THANKS James,

Great tip!  We are already doing some of this. 
The old code was using the same fonts, just reading  'OPTION'("Stdfont") to refactor the size, so I was thinking of adding "GraphicFont" as well thinking it was needed for the graphic fonted text labels. 

Now  hopefully someone will be able to point out where DPI value is available in the system. 
Title: Re: Accommodate different monitor sizes
Post by: James Zukowski on May 24, 2019, 10:24:31 AM
That would be in fin(0,"XYMonitors").