]> git.saurik.com Git - wxWidgets.git/commitdiff
added another DoEraseBackground overload (no real changes)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Nov 2004 20:50:25 +0000 (20:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Nov 2004 20:50:25 +0000 (20:50 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/notebook.h
src/msw/notebook.cpp

index f732ce9da516468bfb139ab6abe00d743f6b2082..c08588371470347ddea081832557a67317f300f2 100644 (file)
@@ -165,6 +165,9 @@ public:
   // handler for child pages erase background event
   void DoEraseBackground(wxEraseEvent& event);
 
+  // real implementation of the above method
+  void DoEraseBackground(wxWindow *win, WXHDC hDC);
+
   // get the brush to be used for painting the background for the controls
   // which need it in their MSWControlColor()
   //
index 3741960c93090267e12eb41e8b5f219514ca04f4..ca44a566189b09dbd73708c59cff736d337c8b22 100644 (file)
@@ -909,19 +909,23 @@ WXHBRUSH wxNotebook::GetThemeBackgroundBrush(WXHDC hDC, wxWindow *win) const
 }
 
 void wxNotebook::DoEraseBackground(wxEraseEvent& event)
+{
+    DoEraseBackground((wxWindow *)event.GetEventObject(),
+                      (WXHDC)GetHdcOf(*event.GetDC()));
+}
+
+void wxNotebook::DoEraseBackground(wxWindow *win, WXHDC hDC)
 {
     // we can either draw the background ourselves or let DrawThemeBackground()
     // do it, but as we already have the correct brush, let's do it ourselves
     // (note that we use the same code in wxControl::MSWControlColor(), so if
     // it breaks, it should at least break in consistent way)
-    wxWindow *win = (wxWindow *)event.GetEventObject();
-    HDC hdc = GetHdcOf(*event.GetDC());
-    WXHBRUSH hbr = GetThemeBackgroundBrush((WXHDC)hdc, win);
+    WXHBRUSH hbr = GetThemeBackgroundBrush(hDC, win);
     if ( hbr )
     {
         RECT rectClient;
         ::GetClientRect(GetHwndOf(win), &rectClient);
-        ::FillRect(hdc, &rectClient, (HBRUSH)hbr);
+        ::FillRect((HDC)hDC, &rectClient, (HBRUSH)hbr);
     }
 }