]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
Take src x, y into account when blitting with alpha
[wxWidgets.git] / src / msw / notebook.cpp
index 669d99dadec3c0d321bd1aa2f0d9e89ee3b57c82..c8663ee71d0afb2cc80b9aa24cb0c1358adba308 100644 (file)
@@ -964,8 +964,9 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
         //
         wxWindow * const parent = GetParent();
 
-        const bool isFromParent = event.GetEventObject() == parent;
-        const bool isFromSelf = event.GetEventObject() == this;
+        // the wxObject* casts are required to avoid MinGW GCC 2.95.3 ICE
+        const bool isFromParent = event.GetEventObject() == (wxObject*) parent;
+        const bool isFromSelf = event.GetEventObject() == (wxObject*) this;
 
         if ( isFromParent || isFromSelf )
         {
@@ -1115,6 +1116,29 @@ bool wxNotebook::MSWPrintChild(WXHDC hDC, wxWindow *child)
     if ( !UseBgCol() && DoDrawBackground(hDC, child) )
         return true;
 
+    // If we're using a solid colour (for example if we've switched off
+    // theming for this notebook), paint it
+    if (UseBgCol())
+    {
+        wxRect r = GetPageSize();
+        if ( r.IsEmpty() )
+            return false;
+
+        RECT rc;
+        wxCopyRectToRECT(r, rc);
+
+        // map rect to the coords of the window we're drawing in
+        if ( child )
+            ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2);
+
+        wxBrush brush(GetBackgroundColour());
+        HBRUSH hbr = GetHbrushOf(brush);
+       
+        ::FillRect((HDC) hDC, &rc, hbr);
+
+        return true;
+    }
+
     return wxNotebookBase::MSWPrintChild(hDC, child);
 }