Declared DateTimePicker has tiny text on HiDPI

There’s a neat example of a Win32 DateTimerPicker in the old Windows Functionality Suite, and I tried to update it which worked – somewhat. Only on my iMac Retina screen under Parallels Win 10 the picker’s text displays in a tiny size. Apparently it is not recalculated for HiDPI.
Did anyone encounter this and are there means to handle it?

Better retest it on a real Win machine. I often see Scaling Issues on Parallels VM on my Mac. And i always have the latest Version of Parallels. One day everything is scaled like it should and the next day it’s messed up, without me changing anything in Code or in the VM…

Hi Ulrich,

Do you happen to have a running example of the DatePicker calls with the old Windows Functionality Suite?

I’ll take a look at it and see what I can do.

Hi Eugene,
the example you’ll find in the repository is still working. And it presents the same result when I run on HiDPI.

Thanks Sascha,
problem is I don’t have a native Windows installation with a HiDPI setting. If I don’t find a clue, would you mind testing a sample project for me if you happen to own a HiDPI Windows setup?

[quote=407121:@Ulrich Bogun]There’s a neat example of a Win32 DateTimerPicker in the old Windows Functionality Suite, and I tried to update it which worked – somewhat. Only on my iMac Retina screen under Parallels Win 10 the picker’s text displays in a tiny size. Apparently it is not recalculated for HiDPI.
Did anyone encounter this and are there means to handle it?[/quote]

Yo have to create a font with a declare CreateFont and then seting the font with the WM_SETFONT message using another declare, SendMessage

[quote=407230:@Ulrich Bogun]Hi Eugene,
the example you’ll find in the repository is still working. And it presents the same result when I run on HiDPI.

Thanks Sascha,
problem is I don’t have a native Windows installation with a HiDPI setting. If I don’t find a clue, would you mind testing a sample project for me if you happen to own a HiDPI Windows setup?[/quote]

Sure

HI Ulrich,

I downloaded Paul’s WFS at: WFS. Code that is unrelated to the datepicker did not work and I modified the code to make it work. :slight_smile:

The datepicker was run in 32-bit mode on my native Windows 10 OS and the DPI appear to be the same, here is a screen grab with HiDPI on and HiDPI off.

Is this what was being seen on the Mac?

With a scaled down picture is hard to tell what you see there.

Thanks for letting me know Pedro.

Here is a link to download the png file so that you can change the scale.

HiDPI Date Picker

Eugene, I don’t like that site. When I click view image I get a pop-up with this:

Thanks for letting me know that this appears on a Mac Alberto. Is there another free site that allows files to be downloaded that doesn’t show this on a Mac?

Much appreciated.

You just need an ad blocker

In this case, you can use imgur, can be posted in the forum without scalling.

[quote=407245:@Eugene Dakin]I downloaded Paul’s WFS at: WFS . Code that is unrelated to the datepicker did not work and I modified the code to make it work. :slight_smile:

The datepicker was run in 32-bit mode on my native Windows 10 OS and the DPI appear to be the same, here is a screen grab with HiDPI on and HiDPI off.[/quote]

Now, looking at the new image, is what I think, Paul created the datepicker class, but he did not asign a font to it. Thats why is not rendered antialiased nor with cleartype.

I created a Imgur account as Pedro suggested (Thanks Pedro!) and here is the link. Does this work better on a Mac by not showing a nagging screen?

HiDPI Date Picker

Here is the difference if you add a font to the control:

(Image is zoomed)

Hello @Ulrich Bogun

I fear i misinterpreted your question. I am sorry, but i do not have access to a real Windows Machine with a HiDPI Monitor attached. :frowning:

Thank you all again!
@Sascha: Never mind. I think especially Pedro put me on the right track.

@Eugene: The problem happens when you are running this on a HiDPI screen, not just from HiDPI capability setting. I’ll upload a screenshot later when I am on my iMac.

@Pedro: Without having tested your code yet, this looks like the true reason. I’ll give it a try later today. Thank god it’s only 14 parameters for a CreateFont call …??!! :wink:

Unles you want something special, you can just use the default values, for my test I did that:

Soft Declare Function CreateFontA Lib "Gdi32"( cHeight As Int32, cWidth As Int32, cEscapement As Int32, cOrientation As Int32, cWeight As Int32, bItalic As UInt32, bUnderline As UInt32, bStrikeOut As UInt32, iCharSet As UInt32, iOutPrecision As UInt32, iClipPrecision As UInt32, iQuality As UInt32, iPitchAndFamily As UInt32, lpszFace As CString )As Integer
Dim iFont As Integer
iFont  = CreateFontA(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Segoe UI")
Const WM_SETFONT  = &h0030
Soft Declare Function SendMessageW Lib "User32" ( hWnd As Integer, msg As Integer, wParam As Integer, lParam As Integer ) As Integer
Call SendMessageW( mWnd, WM_SETFONT, iFont, 1)

Thank you, Pedro! Fontsize 0 is standard size?
BTW, msg should be a UInt32, I guess.

Yes, it uses the OS real default font size (Not the same as Xojo with font = 0)

Also yes

Thanks again to all of you! Looks now mostly nice in most circumstances, and I could even tackle the custom date text together with the custom constants as events.

What I could not achieve: Windows draws the checkbox too big on a HiDPI screen when I enable the NoDate option. I guess that is again a problem of the non-perfect win32 HiDPI support. Are there any means to influence the graphics context of the symbol so that it is drawn in correct size? With the custom text, it does not look as ugly as before when the text started right at the edge of the checkbox. But there’s still room for improvement …

And: There are a few messages I cannot get to work. Did you ever experiment with DateRange for example?