The code in wxFrameBase::SetToolBar() didn't work correctly when toolbar was
unset using SetToolBar(NULL) because the frame toolbar pointer was reset
before layout was done resulting in the frame not recognizing its (still
existing) toolbar child as one of its bars and so nothing was done at all when
the frame had a single child, as in the toolbar sample.
Correct this by carefully ensuring that the toolbar pointer is still set at
the moment of the layout but hide the toolbar to ensure that no place is
allocated for it.
Also mention that it is not necessary to call SetToolBar(NULL) at all if the
toolbar is being deleted anyhow in the sample as toolbar does this itself in
its destructor.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Handling erase background events for toolbars never worked for the ports other
than wxMSW and now it doesn't work for MSW neither as we need to skip erasing
the background in WM_ERASEBKGND handler to avoid flicker which would result
from erasing the background twice, from there and from WM_PAINT handler which
must do it. So don't even try to test if it works, it's unlikely to be very
useful anyhow.
This reverts the change to this file in r62805.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Stretchable spaces consume all extra toolbar space not allocated to the fixed
size items. They can in particular be used to right-align (some) toolbar tools.
Add and document the new API, change the sample to show it and implement it
for MSW, GTK and OS X/Cocoa.
Also refactor MSW background erasing/repainting code to avoid duplicated calls
to DrawThemeBackground(), call it from a new helper MSWEraseRect() function.
Note that we may want to add support for "invisible" separators, IOW
non-stretchable spaces. This could be easily done for MSW after the changes in
this commit and is supported natively by GTK+ and Cocoa so implementing this
would be trivial if there is any interest.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Remove the test which prevented the generation of erase background events from
wxMSW::wxWindow::HandleEraseBkgnd(). Although it is true that native controls
mostly erase background on their own, there are exceptions: we must erase the
background of wxToolBar ourselves, for example. More importantly, there is no
reason to prevent the user code from defining wxEVT_ERASE_BACKGROUND handlers
for the native controls as this works just fine under MSW (although it doesn't
under GTK nor probably other ports...). So also add a test erase background
handler to the toolbar sample to verify that this does work.
Closes#11514.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Unfortunately 0.2.7 release contained a bug in msvc backend which resulted in
warnings generated for each file compiled. Apply the fix from bakefile svn to
fix this (and test if no other problems are found).
Also update all makefile.unx after changes of r62477.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This should have been committed together with the changes to the debug flags
handling in build/bakefiles in r61887.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1. Don't destroy the control in wxToolBar::RemoveTool() as this prevents
it from being added back with is the purpose of using RemoveTool() rather
than DeleteTool().
2. Call wxToolBarTool::Attach/Detach() from the base code, not just from wxMSW
and wxMac (wasn't called by wxGTK at all).
3. Allow adding back the removed control tool in wxGTK.
4. Add test for removing/adding back a control tool to the sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52840 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775