]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toolbar.cpp
Fixed some warnings
[wxWidgets.git] / src / msw / toolbar.cpp
index 884fedaf40253e60a8b41566a4378253140ec11b..8052cec705067fa96b8e57513fba22de61201981 100644 (file)
@@ -1053,6 +1053,14 @@ bool wxToolBar::Realize()
                         break;
                 }
 
                         break;
                 }
 
+                // Instead of using fixed widths for all buttons, size them
+                // automatically according to the size of their bitmap and text
+                // label, if present. This particularly matters for toolbars
+                // with the wxTB_HORZ_LAYOUT style: they look hideously ugly
+                // without autosizing when the labels have even slightly
+                // different lengths.
+                button.fsStyle |= TBSTYLE_AUTOSIZE;
+
                 bitmapId++;
                 break;
         }
                 bitmapId++;
                 break;
         }
@@ -1687,7 +1695,9 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event)
 // toolbar icons with comctl32.dll < 6.0.
 void wxToolBar::OnEraseBackground(wxEraseEvent& event)
 {
 // toolbar icons with comctl32.dll < 6.0.
 void wxToolBar::OnEraseBackground(wxEraseEvent& event)
 {
+#ifdef wxHAS_MSW_BACKGROUND_ERASE_HOOK
     MSWDoEraseBackground(event.GetDC()->GetHDC());
     MSWDoEraseBackground(event.GetDC()->GetHDC());
+#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
 }
 
 bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
 }
 
 bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)