From 93489fc8f15eef3bb618682c0a32f648550ddc56 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Feb 2006 00:39:17 +0000 Subject: [PATCH] always send TB_AUTOSIZE in UpdateSize(), even if we're not attached to a frame git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/tbar95.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 7bc8e9589d..4ea8f81da2 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -1230,17 +1230,16 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const void wxToolBar::UpdateSize() { + ::SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0); + // In case Realize is called after the initial display (IOW the programmer // may have rebuilt the toolbar) give the frame the option of resizing the // toolbar to full width again, but only if the parent is a frame and the // toolbar is managed by the frame. Otherwise assume that some other // layout mechanism is controlling the toolbar size and leave it alone. - wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); if ( frame && frame->GetToolBar() == this ) { - // the toolbar size changed - ::SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0); frame->SendSizeEvent(); } } -- 2.47.2