Jump to content
MathiasBurbach

High DPI & anchoring in Delphi 11

Recommended Posts

Hello Folks!
 

After watching Ray Konopka’s brilliant presentation on Leveraging High DPI in VCL Applications at the ADUG symposium, we thought it is time to move our project to Delphi 11 and use TImageContainer and TVirtualImageList components. Our customer suggested to use the Google icons 1 that are available in different resolutions under the Apache License scheme.

The icons are scaling well in toolbars, bit buttons and Delphi’s own DB navigator. What we did not expect but are witnessing is problems with right anchored labels. Right anchored controls move nicely to the new DPI setting of the second screen and back to the original 96 dpi of the first screen. But labels move out and not back. The second screen is set to of 150% scaling.

 

The source code is available for download from here.
For those not having Delphi 11 the executable is available for download from here.

 

If I move the label into a panel, align the label left and the panel to the right it is working too.

At this stage it seems I need to calculate the left position of the right aligned label each time TFrom.OnAfterMonitorDpiChanged is triggered. That can’t be true.

 

Any ideas how to trick Delphi into doing the right thing?

 

Salut,
Mathias

Share this post


Link to post

Hello Mathias,

4 hours ago, MathiasBurbach said:

That can’t be true.

At least it is not intended, but as you have a reproducible test case you should file a report in QP

 

Regards

Uwe

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×