]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/win32.cpp
avoiding nesting dcs on the same window concurrently
[wxWidgets.git] / src / univ / themes / win32.cpp
index 6e5d9661c2d829cf1a68b7f5c25f2becac653677..3f5416cbc8c4f3a7e327e4e8b94786bcdad9ab5f 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/univ/theme.h"
+
+#if wxUSE_THEME_WIN32
+
 #ifndef WX_PRECOMP
     #include "wx/timer.h"
     #include "wx/intl.h"
@@ -65,7 +69,6 @@
 #include "wx/univ/inpcons.h"
 #include "wx/univ/inphand.h"
 #include "wx/univ/colschem.h"
-#include "wx/univ/theme.h"
 
 // ----------------------------------------------------------------------------
 // constants
@@ -213,10 +216,12 @@ public:
     virtual wxCoord GetCheckItemMargin() const
         { return 0; }
 
+#if wxUSE_TOOLBAR
     virtual wxSize GetToolBarButtonSize(wxCoord *separator) const
         { if ( separator ) *separator = 5; return wxSize(16, 15); }
     virtual wxSize GetToolBarMargin() const
         { return wxSize(4, 4); }
+#endif // wxUSE_TOOLBAR
 
 #if wxUSE_TEXTCTRL
     virtual wxRect GetTextTotalArea(const wxTextCtrl *text,
@@ -1067,7 +1072,7 @@ wxWin32Theme::~wxWin32Theme()
 {
     delete m_renderer;
     delete m_scheme;
-    wxArtProvider::RemoveProvider(m_artProvider);
+    delete m_artProvider;
 }
 
 wxRenderer *wxWin32Theme::GetRenderer()
@@ -1715,7 +1720,7 @@ void wxWin32Renderer::DrawToolBarButton(wxDC& dc,
         {
             int xpoint = (rect.GetLeft() + rect.GetRight() + 1 - bitmap.GetWidth()) / 2;
             int ypoint = (rect.GetTop() + rect.GetBottom() + 1 - bitmap.GetHeight()) / 2;
-            dc.DrawBitmap(bitmap, xpoint, ypoint);
+            dc.DrawBitmap(bitmap, xpoint, ypoint, bitmap.GetMask() != NULL);
         }
     }
     else if (style == wxTOOL_STYLE_SEPARATOR)
@@ -3770,3 +3775,5 @@ bool wxWin32FrameInputHandler::HandleActivation(wxInputConsumer *consumer,
 
     return wxStdInputHandler::HandleActivation(consumer, activated);
 }
+
+#endif // wxUSE_THEME_WIN32