]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Added IsTopLevel() check to last message loop in PreProcessMessage. This
[wxWidgets.git] / src / msw / window.cpp
index bcba0c04c8e24789e53abab5b914b4b104772338..70f74831c8063ff4a9a0abfaa43c4a2971bfc0f8 100644 (file)
@@ -332,8 +332,8 @@ wxCONSTRUCTOR_DUMMY(wxWindow)
 #endif // __WXUNIVERSAL__/__WXMSW__
 
 BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase)
-    EVT_ERASE_BACKGROUND(wxWindowMSW::OnEraseBackground)
     EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged)
+    EVT_ERASE_BACKGROUND(wxWindowMSW::OnEraseBackground)
 #ifdef __WXWINCE__
     EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog)
 #endif
@@ -3111,7 +3111,7 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass,
     // do create the window
     wxWindowCreationHook hook(this);
 
-    // VZ: anyonce cares to explain why is this done for CE?
+    // VZ: anyone care to explain why this is done for CE?
 #ifdef __WXWINCE__
     if (extendedStyle == 0)
     {
@@ -4050,29 +4050,6 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc)
     if ( ::IsIconic(GetHwnd()) )
         return true;
 
-#if 0
-    if (GetParent() && GetParent()->GetExtraStyle() & wxWS_EX_THEMED_BACKGROUND)
-    {
-        return false;
-    }
-
-    if (GetExtraStyle() & wxWS_EX_THEMED_BACKGROUND)
-    {
-        if (wxUxThemeEngine::Get())
-        {
-            WXHTHEME hTheme = wxUxThemeEngine::Get()->m_pfnOpenThemeData(GetHWND(), L"TAB");
-            if (hTheme)
-            {
-                WXURECT rect;
-                ::GetClientRect((HWND) GetHWND(), (RECT*) & rect);
-                wxUxThemeEngine::Get()->m_pfnDrawThemeBackground(hTheme, hdc, 10 /* TABP_BODY */, 0, &rect, &rect);
-                wxUxThemeEngine::Get()->m_pfnCloseThemeData(hTheme);
-                return true;
-            }
-        }
-    }
-#endif
-
     wxDCTemp dc(hdc);
 
     dc.SetHDC(hdc);
@@ -4093,10 +4070,24 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc)
 
 void wxWindowMSW::OnEraseBackground(wxEraseEvent& event)
 {
+    if ( GetBackgroundStyle() == wxBG_STYLE_CUSTOM )
+    {
+        // don't skip the event here, custom background means that the app is
+        // drawing it itself in its OnPaint()
+        return;
+    }
+
+    if ( !m_hasBgCol )
+    {
+        event.Skip();
+        return;
+    }
+
+    // we have a fixed solid background colour, do use it
     RECT rect;
     ::GetClientRect(GetHwnd(), &rect);
 
-    wxColour backgroundColour( GetBackgroundColour());
+    wxColour backgroundColour(GetBackgroundColour());
     COLORREF ref = PALETTERGB(backgroundColour.Red(),
                               backgroundColour.Green(),
                               backgroundColour.Blue());