[wx-dev] controls in toolbars broken in MSW and toolbar sample
weirdness
Vadim Zeitlin
vadim at wxwidgets.org
Sun Dec 2 09:27:26 PST 2007
On Wed, 28 Nov 2007 18:06:22 +0100 I wrote:
VZ> The controls don't appear in MSW toolbars any more, including in my own
VZ> program and the toolbar sample. Apparently they are not positioned
VZ> correctly (the coordinates shown by Spy++ are negative). Does anyone
VZ> remember any recent changes which could have resulted in this?
As nobody remembered, I did the tests myself and it turns out the problem
was due to the background background "fixes" (r48555, 48552, 48549, 48451),
see http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/src/msw/tbar95.cpp
If I remove the code setting toolbar background colour, the controls
appear again. Of course, the real problem is probably not only that the
background colour is set (although this seems wrong too: I have no idea
about what the Silver theme is but how can overriding the theme background
with a solid colour fix anything?) but that setting it makes the controls
disappear so it should be probably fixed in wxToolBar::OnEraseBackground()
but I don't understand anything there, starting with the need for this
function existence (the comment speaks about children of notebook pages but
this probably applies to all children so how does it explain the behaviour
of this function which does whatever it does for toolbars only and whether
they are children of notebook or not?), so unfortunately I can't do this.
For now I'll just revert setting the background colour because however
important this Silver theme is, showing the controls in the toolbar is
surely more important. Unfortunately it seems that the same "fix" made it
into 2.8.7 (was it really so important and so trivial to be applied to the
stable branch without any testing? I really don't think so...) and, unless
I'm missing something, should be removed from there as well. I hope Julian
can do it because you should know/remember more about this than I do.
VZ> Further, the toolbar sample now looks really weird. Robert, do we really
VZ> need these controls there? They have nothing whatsoever to do with toolbars
VZ> and while I appreciate that you need to be able to test them, I'd suggest
VZ> the widgets sample for this, not this one. Could we please undo r49790?
And unless there are objections to this I'd still like to do it too.
Thanks,
VZ
More information about the wx-dev
mailing list