TwwDBGrid not showing checkboxes correctly in high DPI

Comments

4 comments

  • Roy Woll

    Please download 22.1.0.9 and let me know your results. There was a change made in July 2023 relating to the painting of checkboxes.

    0
    Comment actions Permalink
  • Charles Heaps

    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...

    0
    Comment actions Permalink
  • Roy Woll

    Yes, that change is already in the most recent build for Delphi 12.

        StyleServices(self).DrawElement(Canvas.Handle, Details, PaintRect, nil, CurrentPPI); // 7/30/2023 

     

    0
    Comment actions Permalink
  • Charles Heaps

    Super - thanks!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk