]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tbar95.cpp
no real changes, just use more readable helper wxTextEntry methods (patch 1910160)
[wxWidgets.git] / src / msw / tbar95.cpp
index f8a827fbcf5669d4726ce62bd8f0fd01fef934aa..16ebe1ffc1e571455afdd10fc5bfc5c56fada6e5 100644 (file)
@@ -47,6 +47,7 @@
 #include "wx/dcclient.h"
 
 #include "wx/msw/private.h"
+#include "wx/msw/dc.h"
 
 #if wxUSE_UXTHEME
 #include "wx/msw/uxtheme.h"
@@ -309,13 +310,6 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size)
         ::SendMessage(GetHwnd(), TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS);
 #endif
 
-    // Fix a bug on e.g. the Silver theme on WinXP where control backgrounds
-    // are incorrectly drawn, by forcing the background to a specific colour.
-    int majorVersion, minorVersion;
-    wxGetOsVersion(& majorVersion, & minorVersion);
-    if (majorVersion < 6)
-        SetBackgroundColour(GetBackgroundColour());
-
     return true;
 }
 
@@ -811,8 +805,8 @@ bool wxToolBar::Realize()
                 TBREPLACEBITMAP replaceBitmap;
                 replaceBitmap.hInstOld = NULL;
                 replaceBitmap.hInstNew = NULL;
-                replaceBitmap.nIDOld = (UINToldToolBarBitmap;
-                replaceBitmap.nIDNew = (UINThBitmap;
+                replaceBitmap.nIDOld = (UINT_PTR)oldToolBarBitmap;
+                replaceBitmap.nIDNew = (UINT_PTR)hBitmap;
                 replaceBitmap.nButtons = nButtons;
                 if ( !::SendMessage(GetHwnd(), TB_REPLACEBITMAP,
                                     0, (LPARAM) &replaceBitmap) )
@@ -841,7 +835,7 @@ bool wxToolBar::Realize()
         {
             TBADDBITMAP addBitmap;
             addBitmap.hInst = 0;
-            addBitmap.nID = (UINThBitmap;
+            addBitmap.nID = (UINT_PTR)hBitmap;
             if ( ::SendMessage(GetHwnd(), TB_ADDBITMAP,
                                (WPARAM) nButtons, (LPARAM)&addBitmap) == -1 )
             {
@@ -921,7 +915,7 @@ bool wxToolBar::Realize()
                 {
                     const wxString& label = tool->GetLabel();
                     if ( !label.empty() )
-                        button.iString = (int)label.wx_str();
+                        button.iString = (INT_PTR)label.wx_str();
                 }
 
                 button.idCommand = tool->GetId();
@@ -1599,7 +1593,10 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event)
 
 #endif // wxUSE_UXTHEME
 
-    if ( UseBgCol() || (GetMSWToolbarStyle() & TBSTYLE_TRANSPARENT) )
+    // we need to always draw our background under XP, as otherwise it doesn't
+    // appear correctly with some themes (e.g. Zune one)
+    if ( majorVersion == 5 ||
+            UseBgCol() || (GetMSWToolbarStyle() & TBSTYLE_TRANSPARENT) )
     {
         // do draw our background
         //