]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tbar95.cpp
Fix by George Wismer to get flat toolbars under Windows Classic style,
[wxWidgets.git] / src / msw / tbar95.cpp
index 83fcc8a1e6c8818684fe2ab79ad44252ffe20872..ef132e74089dd5bf299731150df7e4c50ce00fcc 100644 (file)
@@ -246,6 +246,19 @@ bool wxToolBar::Create(wxWindow *parent,
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
     SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
 
+    // workaround for flat toolbar on Windows XP classic style
+    if ( style & wxTB_FLAT )
+    {
+        DWORD dwToolbarStyle;
+
+        dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L );
+        
+        if ((dwToolbarStyle & TBSTYLE_FLAT) == 0)
+        {
+            dwToolbarStyle |= TBSTYLE_FLAT;
+            ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, (LPARAM)dwToolbarStyle );
+        }
+    }
     return TRUE;
 }
 
@@ -256,7 +269,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size)
 
     // toolbar-specific post initialisation
     ::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
-
+    
     return TRUE;
 }