Cocoa: Drawing issue for custom-drawn listbox
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
Owner-drawn listboxes (Style = lbOwnerDrawFixed) have some issues in Cocoa:
(1) Transparent Bitmaps are drawn up-side down
(2) ThemeServices are ignored.
Steps to reproduce:
Run attached demo.
(1) At the left, there is an owner-drawn listbox which draws bitmaps as icons for each listbox item. One icon is a runtime created bitmap, a red diagonal line running from top-left to right-bottom, on yellow background - in the listbox, however, the line runs from left-bottom to right-top. The same code is used for drawing the line in the OnPaint event of a Paintbox below - now the line is drawn correctly. The other icon displays a bitmap created by drawing a themed checkmark. Again, the checkmark is inverted. Note that the bitmap must be transparent for this effect to occur.
(2) The owner-drawn listbox at the right is supposed to display checkboxes in front of the listbox item texts. These checkboxes are drawn immediately by calling the ThemeServices.Drawelement for the Listbox canvas. However, nothing is drawn. The paintbox below the listbox uses the same code to draw in the OnPaint event - no problem here.
The same program when run on Windows or Linux/gtk2/qt works as expected.
Additional information:
See also attached screenshots.
Possibly related:
0036021: Cocoa Catalina: ComboBox text appears upside down
Tested with:
- Lazarus 2.1.0 r62644M FPC 3.0.4 x86_64-darwin-cocoa (beta) --> reported behavior
- Lazarus 2.1.0 r62638M FPC 3.0.4 i386-win32-win32/win64 -- > ok
- Lazarus 2.1.0 r62587M FPC 3.0.2 i386-linux-gtk2 or qt --> ok
Additional observation:
- Cocoa always reports ThemeServices.ThemesEnables and ThemeServices.ThemesAvailable as false. Is this correct?
Mantis conversion info:
- Mantis ID: 36714
- OS: Mojave
- OS Build: 10.14
- Platform: Mac OS / Cocoa
- Monitored by: » @neurolabusc1 (Chris Rorden)