]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1218849 ] [wxMSW] Removes magic numbers from wxNotebook
authorJulian Smart <julian@anthemion.co.uk>
Thu, 16 Jun 2005 15:34:41 +0000 (15:34 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 16 Jun 2005 15:34:41 +0000 (15:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/notebook.cpp

index 5694d072b999c5f850858769cd3a9fc8c69842e5..6d9f5b112ae798a054e138e24cc6abb81bde24bb 100644 (file)
@@ -967,7 +967,7 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event)
       {
         wxNotebookPage *pPage = m_pages[sel];
         pPage->Show(true);
-        
+
         // As per bug report:
         // http://sourceforge.net/tracker/index.php?func=detail&aid=1150659&group_id=9863&atid=109863,
         // we should not set the page focus (and thereby the focus for
@@ -1102,17 +1102,17 @@ bool wxNotebook::DoDrawBackground(WXHDC hDC, wxWindow *child)
     if ( child )
         ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2);
 
-
-    // apparently DrawThemeBackground() modifies the rect passed to it and if we
-    // don't do these adjustments, there are some drawing artifacts which are
-    // only visible with some non default themes; so modify the rect here using
-    // the magic numbers below so that it still paints the correct area
-    rc.left   -= 2;
-    rc.top    -= 2;
-    rc.right  += 4;
-    rc.bottom += 5;
-
-
+    // we have the content area (page size), but we need to draw all of the
+    // background for it to be aligned correctly
+    wxUxThemeEngine::Get()->GetThemeBackgroundExtent
+                            (
+                                theme,
+                                (HDC) hDC,
+                                9 /* TABP_PANE */,
+                                0,
+                                &rc,
+                                &rc
+                            );
     wxUxThemeEngine::Get()->DrawThemeBackground
                             (
                                 theme,