TwwDBGrid not showing checkboxes correctly in high DPI
Hi Roy,
I'm trying to get my app working in high DPI. Have made good progress and followed your various guidelines. However, checkboxes in a TwwDBGrid are not being properly scaled so look tiny on high DPI screens. I'm using Delphi 11.3 and Infopower 22.1.0.5. The form is scaled. Do you know if this is a known bug? If so, any chance it might get addressed soon? If not, any advice on how to work around this? Also, is there any way to have the grid checkboxes respect those from the current Delphi theme? See screenshot:
Thanks in advance!
P.S. Is this the right place to post? I see there is almost no activity on this forum and posts very rarely get answered.
-
Thaks for this Roy, I DID have disablethemes true for the above grid. Duh!
I think I also found the issue why checkmarks are sometimes the wrong size. I think you need to change a line of code in wwdbigrd in routine TwwCustomDBGrid.DrawCheckBox_Checkmark from this:
StyleServices.DrawElement(Canvas.Handle, Details, PaintRect, nil, Screen.PixelsPerInch);
to this:
StyleServices.DrawElement(Canvas.Handle, Details, PaintRect, nil, self.CurrentPPI);I think its because a form may sometime be on a different monitor from the main program screen and that form may have a different PPI.
In general, I don't think you can rely upon Screen.PixelsPerInch to be valid for a grid that is not on the main form. Perhaps that has implications elsewhere? However, I am VERY FAR from being an expert on this stuff.
Either way, I hope this is useful...
Please sign in to leave a comment.
Comments
4 comments