https://bugs.winehq.org/show_bug.cgi?id=44633
Bug ID: 44633 Summary: Checboxes and Radiobuttons blank out the text area that follows them Product: Wine Version: 3.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 Assignee: wine-bugs@winehq.org Reporter: ryampolsky@yahoo.com Distribution: ---
Because it's not possible to control the text color for themed checkboxes and radiobuttons, I have implemented a kludge in my app that works on Windows, but not WINE. I create checkboxes and radiobuttons as two widgets: the button, with a null text string (but sized as if it contained the text so that clicking on the text still activates the button), followed by a static text item for the label, which I draw in black or white depending on the background color.
I process the WM_CTLCOLOR... messages, and set the background mode to TRANSPARENT, but I return a non-null background brush. If I don't do that, the button's focus rectangle doesn't go away when it loses focus. But since the text is null, Windows doesn't draw anything where the text would go. My static text control draws in the same place - resulting in what looks like a normal check/radiobutton, but with the text in the color I want.
This works fine on Windows, and I think it used to work under WINE (but don't quote me - this is a recent feature, and I may have never tested it under a prior version of WINE). In version 3.2 at least, the radiobutton or checkbox seems to be overwriting my static text control - so that I don't see the text at all. I.e., WINE is drawing the full text rectangle, even though it contains a null string. Either Windows only draws the rectangle for the actual 0-sized text string, or it's order of operations allows my static text to remain visible. But in Windows, there's no 'flashing' of the text, so I suspect the background rectangle is being sized to the null string and the static label is never erased and redrawn.
In WINE, when I click the radiobutton, I can see my static text label flash on - but it is immediately overwritten by a blank text rectangle drawn by WINE. Yes, my code is a bit of a kludge, but it works on Windows (and I know of no other way to control the color of check/radiobutton text). It'd be nice if it worked on WINE too, no?