]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
wxUSE_TOOLTIPS and wxUSE_IMAGE furthur fixes
[wxWidgets.git] / src / msw / notebook.cpp
index 3f2390950ca0b731370110f07cf19c29acf3d690..e73853067695a35904562411e68d26c33f9ae508 100644 (file)
@@ -296,6 +296,15 @@ bool wxNotebook::Create(wxWindow *parent,
     if ( !MSWCreateControl(className, wxEmptyString, pos, size) )
         return false;
 
+    if (HasFlag(wxNB_NOPAGETHEME) || (wxSystemOptions::HasOption(wxT("msw.notebook.themed-background")) &&
+                                      wxSystemOptions::GetOptionInt(wxT("msw.notebook.themed-background")) == 0))
+    {
+        wxColour col = GetThemeBackgroundColour();
+        if (col.Ok())
+        {
+            SetBackgroundColour(col);
+        }
+    }
     return true;
 }
 
@@ -471,7 +480,7 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
     wxSize sizeTotal = sizePage;
 
     // We need to make getting tab size part of the wxWidgets API.
-    wxSize tabSize(0, 0);
+    wxSize tabSize;
     if (GetPageCount() > 0)
     {
         RECT rect;
@@ -618,7 +627,7 @@ bool wxNotebook::InsertPage(size_t nPage,
     }
 
     // and the text
-    if ( !strText.IsEmpty() )
+    if ( !strText.empty() )
     {
         tcItem.mask |= TCIF_TEXT;
         tcItem.pszText = (wxChar *)strText.c_str(); // const_cast
@@ -683,16 +692,6 @@ bool wxNotebook::InsertPage(size_t nPage,
 
     InvalidateBestSize();
 
-    if (HasFlag(wxNB_NOPAGETHEME) || (wxSystemOptions::HasOption(wxT("msw.notebook.themed-background")) &&
-                                      wxSystemOptions::GetOptionInt(wxT("msw.notebook.themed-background")) == 0))
-    {
-        wxColour col = GetThemeBackgroundColour();
-        if (col.Ok())
-        {
-            pPage->SetBackgroundColour(col);
-        }
-    }
-    
     return true;
 }
 
@@ -1003,6 +1002,33 @@ wxColour wxNotebook::MSWGetBgColourForChild(wxWindow *win)
     return c == CLR_INVALID ? wxNullColour : wxRGBToColour(c);
 }
 
+bool
+wxNotebook::MSWPrintChild(wxWindow *win,
+                          WXWPARAM wParam,
+                          WXLPARAM WXUNUSED(lParam))
+{
+    RECT rc;
+    ::GetClientRect(GetHwnd(), &rc);
+    TabCtrl_AdjustRect(GetHwnd(), true, &rc);
+    ::MapWindowPoints(GetHwnd(), GetHwndOf(win), (POINT *)&rc, 2);
+
+    wxUxThemeHandle theme(win, L"TAB");
+    if ( theme )
+    {
+        wxUxThemeEngine::Get()->DrawThemeBackground
+        (
+            theme,
+            (WXHDC)wParam,
+            9 /* TABP_PANE */,
+            0,
+            &rc,
+            NULL
+        );
+    }
+
+    return true;
+}
+
 #endif // wxUSE_UXTHEME
 
 // Windows only: attempts to get colour for UX theme page background