]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toolbar.cpp
Fall back on using tree/list control item text in wxDragImage.
[wxWidgets.git] / src / msw / toolbar.cpp
index 31233565bd00a64bd82e1f518ad4f49fcf46df67..e0a51a13c004b739ebccc8c8e2d4b69ade9df815 100644 (file)
@@ -1219,13 +1219,13 @@ void wxToolBar::UpdateStretchableSpacersSize()
     // reduce their size if there is not enough place for all tools
     const int totalSize = IsVertical() ? GetClientSize().y : GetClientSize().x;
     const int extraSize = totalSize - m_totalFixedSize;
-    const int sizeSpacer = extraSize > 0 ? extraSize / numSpaces : 0;
+    const int sizeSpacer = extraSize > 0 ? extraSize / numSpaces : 1;
 
     // the last spacer should consume all remaining space if we have too much
     // of it (which can be greater than sizeSpacer because of the rounding)
     const int sizeLastSpacer = extraSize > 0
                                 ? extraSize - (numSpaces - 1)*sizeSpacer
-                                : 0;
+                                : 1;
 
     // cumulated offset by which we need to move all the following controls to
     // the right: while the toolbar takes care of the normal items, we must
@@ -1807,7 +1807,7 @@ WXHBRUSH wxToolBar::MSWGetToolbarBgBrush()
     wxBrush * const
         brush = wxTheBrushList->FindOrCreateBrush(colBg);
 
-    return brush ? brush->GetResourceHandle() : 0;
+    return brush ? static_cast<WXHBRUSH>(brush->GetResourceHandle()) : 0;
 }
 
 WXHBRUSH wxToolBar::MSWGetBgBrushForChild(WXHDC hDC, wxWindowMSW *child)