Page 6 of 17

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Sun Jun 03, 2018 10:05 pm
by Dude
kurzer wrote:Simply activate "create DPI aware executable" in the compiler settings and your GUI will be automatically scaled on machines with different monitor DPI settings.
That's how I assumed it works. But it makes no difference on my PC: viewtopic.php?p=522806#p522806

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Sun Jun 03, 2018 11:54 pm
by Kurzer
Dude wrote:
kurzer wrote:Simply activate "create DPI aware executable" in the compiler settings and your GUI will be automatically scaled on machines with different monitor DPI settings.
That's how I assumed it works. But it makes no difference on my PC: viewtopic.php?p=522806#p522806
Hmm, I can't reproduce your problem.
When I compile your code, I'll get two different scaled windows.

But even, if I disable the DPI aware checkbox in the compiler settings, the text in the buttons does not fit.
So I think it's a problem with the font you chose for your desktop. Maybe the DPI awareness cannot handle different font sizes?

Here are my desktop settings:
Image

Here is the result of my test with your example code:
Image

So if this GUI was designed on a 100% scaled desktop, another user with an 125% desktop will see exact the same GUI and sizing proportions. And in both cases the Gagdets are to small for the text.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Mon Jun 04, 2018 3:29 am
by Paul
Dude wrote:
kurzer wrote:Simply activate "create DPI aware executable" in the compiler settings and your GUI will be automatically scaled on machines with different monitor DPI settings.
That's how I assumed it works. But it makes no difference on my PC: viewtopic.php?p=522806#p522806

You guys should be posting the version of Windows you are using.
I find Windows 7 works one way with DPI aware and Windows 10 is completely different.
I also find there are different versions of Windows 10 that give different results as well.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Mon Jun 04, 2018 8:06 am
by Kurzer
I use windows 7 (SP2) with 64 bit.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Mon Jun 04, 2018 3:50 pm
by Frontier
Thank you very much Fred and Purebasic team for this release.
Unfortunately, I get a segmentation fault error on my Arch Linux x64 install (the dependency check script reports that all required libraries are available since I am using PB 5.62 on the same machine) upon launching the 5.70b1 Purebasic executable.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Mon Jun 04, 2018 4:57 pm
by Marc56us
Hi all,

I don't know if it's supposed to work like this, but under XP, set to 120dpi instead of 96dpi and after rebooting (necessary for XP, Vista, Seven ?), I got this

XP 96 to 120 ppp
Image

Vista 96 to 120 ppp
Image

Windows 10 @ 125%
Image

With this code:

Code: Select all

; Enable DPI aware

Debug "DesktopResolution (Factor x, y): " + DesktopResolutionX() + " " + DesktopResolutionY()

OpenWindow(0, 0, 0, 300, 200, "", #PB_Window_SystemMenu)

LoadFont(0, "Verdana", 10)
ButtonGadget(0, 10, 10, 220, 20, "This text must be scaled Down")
SetGadgetFont(0, FontID(0))

LoadFont(1, "Verdana", DesktopUnscaleX(10))
ButtonGadget(1, 10, 50, 220, 20, "This text must be scaled Down")
SetGadgetFont(1, FontID(1))

While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend
The difference is that I reduce the size of the font automatically:

:!: LoadFont(1, "Verdana", DesktopUnscaleX(10))

:arrow: So from what I understand, DPI aware is necessary to activate detection, but is not enough. It is also necessary to indicate which elements should be enlarged or reduced.
DesktopScaleX(), DesktopScaleY(), DesktopUnscaleX(), DesktopUnscaleY() are only used to apply a resizing factor to certain elements (including fonts) if you want to not zoom in everything.
(For example to keep a reference size for items like a rule for example)

:wink:

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Mon Jun 04, 2018 11:09 pm
by Kuron
kurzer wrote:I use windows 7 (SP2) with 64 bit.
This may be part of the problem, because there is no such thing as a SP2 for Windows 7. MS only released SP1.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Tue Jun 05, 2018 1:44 am
by Dude
Kuron wrote:there is no such thing as a SP2 for Windows 7. MS only released SP1.
He probably means this, which is Microsoft's unofficial SP2:

https://answers.microsoft.com/en-us/win ... e1e883051e

I'm on Win 7 SP1 and PureBasic's DPI is no good for me. I'll just keep using my code to do it.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Tue Jun 05, 2018 3:15 am
by netmaestro
Thanks for the new version! And kudos to you for putting family first :mrgreen: DPI awareness is very much right on the button for these days, excellent choice of direction.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Tue Jun 05, 2018 3:43 am
by Kuron
netmaestro wrote:And kudos to you for putting family first :mrgreen:
+1

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed Jun 06, 2018 1:18 pm
by mikejs
Looks like the issue with the SQLConnect win32 api call is still present. This was reported in a couple of other threads, and is currently keeping me on 5.60 (the last version where this worked) for production code. See this thread for more detail:

viewtopic.php?f=4&t=69924

But, in short, when compiled with 5.60, I get references in the binary to SQLConnectW, but with 5.61 and later (including 5.70 beta1) it's just SQLConnect, and the function call doesn't work properly. I've not tested whether the workaround in that thread works with the beta.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed Jun 06, 2018 1:25 pm
by mikejs
In other news though, I'm playing with the DPI-aware stuff and it works great 8-)

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed Jun 06, 2018 9:29 pm
by Fred
A new version has been uploaded for Linux to fix the IDE issues, feel free to give it a try !

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed Jun 06, 2018 11:03 pm
by wombats
Fred wrote:A new version has been uploaded for Linux to fix the IDE issues, feel free to give it a try !
The IDE starts now.

I'm not able to get Qt to work. I installed the libs and set "qt" as the subsystem, but running the example provided by fr34k, I get the following: "QtScript.a(QtScript.o):(.qtversion[qt_version_tag]+0x0): undefined reference to `qt_version_tag'
collect2: error: ld returned 1 exit status".

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed Jun 06, 2018 11:31 pm
by Kurzer
Dude wrote:
Kuron wrote:there is no such thing as a SP2 for Windows 7. MS only released SP1.
He probably means this, which is Microsoft's unofficial SP2:
Exact!