Closed lainz closed 1 year ago
Hi Lainz. I am not sure it is possible because TBGRAThemeSurface accesses the Canvas property of the control and TWinControl doesn't have this property.
If I understand, TCheckListBox has "owner drawn" events where you would like to use TBGRAThemeSurface? Maybe, if at this point there is a canvas provided, it is possible to make an alternate constructor that takes the Canvas as well as a parameter.
Hi yes it has a canvas. Sure an alternative constructor can do.
Ok, Lainz. Go ahead and give it a shot with the alternate constructor idea. I think it's a promising approach. If you need further discussions or face any hurdles, I'm here to help and listen.
Thank you I will try.
Done. Seems that works fine. But I don't have macOS retina to test, can you give a try, the demo is in bgracontrols\test\test_checklistbox
Cool! I've checked it out and it works well.
I've made some adjustments by adding a scale factor and some margin. On MacOS, there's a frame rectangle that inverts the color and it was masking the square of the checkbox. With these changes, it looks good now.
Could you pull the latest and check on your end as well? Let me know if you have any further concerns.
Working well, thankyou! Now we have another working demo =)
Hi @circular17 is possible to inherit this class from TWinControl instead of Custom Control.
For example in Lazarus there is TCheckListBox and I can't use Tbgrathemesurface on its custom drawing.