]> git.saurik.com Git - wxWidgets.git/commitdiff
no changes; just code cleanup in OnEraseBackground()
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Feb 2006 14:01:50 +0000 (14:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Feb 2006 14:01:50 +0000 (14:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/tbar95.cpp

index 4ea8f81da23460de67e5cc2209827c6871fca822..a65d6202db6aa05bd7413268d73447b798634d75 100644 (file)
@@ -1344,34 +1344,27 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event)
 // colour: for example, when it must blend in with a notebook page.
 void wxToolBar::OnEraseBackground(wxEraseEvent& event)
 {
-    wxColour bgCol = GetBackgroundColour();
-    if (!bgCol.Ok())
+    if ( !UseBgCol() )
     {
         event.Skip();
         return;
     }
 
+    wxColour bgCol = GetBackgroundColour();
+
     // notice that this 'dumb' implementation may cause flicker for some of the
     // controls in which case they should intercept wxEraseEvent and process it
     // themselves somehow
 
-    RECT rect;
-    ::GetClientRect(GetHwnd(), &rect);
+    RECT rect = wxGetClientRect(GetHwnd());
 
-    HBRUSH hBrush = ::CreateSolidBrush(wxColourToRGB(bgCol));
+    AutoHBRUSH hBrush(wxColourToRGB(bgCol));
 
     HDC hdc = GetHdcOf((*event.GetDC()));
 
-#ifndef __WXWINCE__
-    int mode = ::SetMapMode(hdc, MM_TEXT);
-#endif
+    wxCHANGE_HDC_MAP_MODE(hdc, MM_TEXT);
 
     ::FillRect(hdc, &rect, hBrush);
-    ::DeleteObject(hBrush);
-
-#ifndef __WXWINCE__
-    ::SetMapMode(hdc, mode);
-#endif
 }
 
 bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)