Scaling issue with TAdvMaskEditBtn

Hello!

I encountered a display error when working with TAdvMaskEditBtn.

Without scaling its fine. But when applying scaling (e.g. ScaleForPPI(153);) a part of the Btn area is overdrawn by the edit control.
This happens while the control is active, when exiting, it is redrawn fine:

The effect differs on the Scale value and Form font size.
DoubleBuffering isnt helping.


(C++Builder Tokyo, VCL UI Pack 13.5.4.0)
IssueExample.zip (56.7 KB)


Thanks!
Björn

The VCL Components currently follow the screen scale. Manually calling ScaleForPPI will have unwanted side-effects. We'll investigate if something can be done about this.

Some more observations about the overdraw effect:

It also happens with your TAdvSmoothDatePicker - without any scaling.
And also with scaling (manual or screen scaling).
image

It does not happen with the TAdvMaskEditBtn without any scaling.
It happens with the TAdvMaskEditBtn when on a scaled monitor OR using ScaleForPPI.

Maybe this can help you find some cause.
I had no problems with VCL-controls when using ScaleForPPI (Combobox, TDateTimerPicker or any other).

Thanks for your help.
Björn


Sample Project with both controls in their default settings.
Nothing special here.
issue2.zip (58.4 KB)

I tested this here with the latest version of TMS VCL UI Pack and latest IDE version 12.3 but I could not see an issue.

Step 1, default DPI setting

and then after programmatically calling ScaleForDPI(153):

For me the glitch is visible, as soon as the control gets activated or some content is typed.

The form might be scaled manually by ScaleForPPI or automatically by moving it to a monitor with a higher scale set in the windows display settings.

I am testing with
(C++Builder Tokyo, VCL UI Pack 13.5.4.0)

We have traced & solved this issue. Next update will address this.

Thanks for your investigation and bugfix.
When the control is embedded in the Form, it looks fine now.

This solves half my cases.
In the other half, my form is embedded in a panel - here the issue remains.


(top: control in form, bottom: control in an embedded form)

This approach works for all common controls.
Because this issue still looks like the old behavior, I hope you might find some missing parameter in the EditRect-calculation.

I broke down this approach in a little demo application which I attached.
When pressing the Load-Button, the form with the AdvMaskEditBtn is loaded.

Thanks for your help


IssueExampleEmbedded.zip (60.0 KB)

This was because you change the scale before the parent is set.
A workaround is to set the scale after the control parent is set. In the next update, we've also handled this particular case that you change the scale before the parent is set.