On Fri, 4 May 2012 17:23:59 +0400 Dimitri Schoolwerth wrote:
DS> I have been looking into this last night, but not having much luck yet
DS> after some experimenting. All I can say (assuming it's the same
DS> problem) is that it was introduced in r62971 and the relevant ticket
DS> is #12307 (so there's no need to open a new one).
Thanks for the reference, I completely forgot about this one but it's true
that it looks like the same problem.
I don't understand however why is it broken for checkboxes too. Looking at
the code in wxToolBar::MSWGetBgBrushForChild(), we should be returning the
correct brush for it (as its HasTransparentBackground() returns true) so
its background should be painted. It might be worth to use some more easily
visible colour (e.g. *wxRED) in wxToolBar::MSWGetToolbarBgBrush() and
sprinkle the code with Update()+Sleep() calls to see how is it really being
drawn (not sure if this is going to work under Win7 with its double
buffering but it worked under XP).
DS> Also when I #undef wxHAS_MSW_BACKGROUND_ERASE_HOOK the entire
DS> background is black, don't know if that's related but I was thinking if
DS> I can fix that then hopefully the problem with black pixels and
DS> controls in a toolbar would also be solved.
We can't use TBSTYLE_FLAT and TBSTYLE_TRANSPARENT if we don't erase the
background so the actual bug here is probably that the code in
wxToolBar::MSWGetStyle() doesn't test for wxHAS_MSW_BACKGROUND_ERASE_HOOK.
IOW I don't think it's the same problem... But I definitely could be wrong.
DS> I also noticed, with a wxComboBox and to some extent a wxButton, the
DS> black pixels disappear when first hovering over another toolbar item
DS> and then the item with black pixels. I thought maybe the community
DS> addition about repainting at
DS>
http://msdn.microsoft.com/en-us/library/windows/desktop/bb760439%28v=vs.85%29.aspx
DS> is relevant to that.
Not sure how/why?
VZ