]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tbar95.cpp
added some utils (tex2rtf, helpgen, makegen) to make system
[wxWidgets.git] / src / msw / tbar95.cpp
index c0f75fc52243b640226eba6f2a56fbf773ed13e0..daa5ab310040f713d51e9496c93a09d87fc93a8d 100644 (file)
@@ -568,7 +568,6 @@ bool wxToolBar::Realize()
                     // the id is probably invalid?
                     wxLogLastError("TB_SETBUTTONINFO");
                 }
-
             }
             else
         #endif // comctl32.dll 4.71
@@ -581,7 +580,7 @@ bool wxToolBar::Realize()
                 TBBUTTON tbb;
                 wxZeroMemory(tbb);
                 tbb.idCommand = 0;
-                tbb.fsState = TBSTATE_ENABLED;
+                tbb.fsState = TBSTATE_ENABLED | TBSTATE_HIDDEN;
                 tbb.fsStyle = TBSTYLE_SEP;
 
                 size_t nSeparators = size.x / widthSep;
@@ -808,7 +807,10 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const
 
 void wxToolBar::UpdateSize()
 {
-    // we must refresh the frame after the toolbar size (possibly) changed
+    // the toolbar size changed
+    SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0);
+
+    // we must also refresh the frame after the toolbar size (possibly) changed
     wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
     if ( frame )
     {
@@ -822,7 +824,6 @@ void wxToolBar::UpdateSize()
         (void)::SendMessage(GetHwndOf(frame), WM_SIZE, SIZE_RESTORED,
                             MAKELPARAM(r.right - r.left, r.bottom - r.top));
     }
-
 }
 
 // ----------------------------------------------------------------------------