factoring out Background setter

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-01-04 10:34:34 +00:00
parent 6eaa4426e0
commit 489d2dd393

View File

@@ -130,7 +130,6 @@ wxWindowDC::wxWindowDC(wxWindow *window)
m_graphicContext = new wxMacCGContext( (CGContextRef) window->MacGetCGContextRef() ) ; m_graphicContext = new wxMacCGContext( (CGContextRef) window->MacGetCGContextRef() ) ;
m_graphicContext->SetPen( m_pen ) ; m_graphicContext->SetPen( m_pen ) ;
m_graphicContext->SetBrush( m_brush ) ; m_graphicContext->SetBrush( m_brush ) ;
SetBackground(MacGetBackgroundBrush(window));
} }
else else
{ {
@@ -142,7 +141,6 @@ wxWindowDC::wxWindowDC(wxWindow *window)
m_graphicContext = new wxMacCGContext( (CGrafPtr) m_macPort ) ; m_graphicContext = new wxMacCGContext( (CGrafPtr) m_macPort ) ;
m_graphicContext->SetPen( m_pen ) ; m_graphicContext->SetPen( m_pen ) ;
m_graphicContext->SetBrush( m_brush ) ; m_graphicContext->SetBrush( m_brush ) ;
SetBackground(MacGetBackgroundBrush(window));
} }
// there is no out-of-order drawing on OSX // there is no out-of-order drawing on OSX
#else #else
@@ -151,8 +149,8 @@ wxWindowDC::wxWindowDC(wxWindow *window)
CopyRgn( (RgnHandle) window->MacGetVisibleRegion(true).GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ; CopyRgn( (RgnHandle) window->MacGetVisibleRegion(true).GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ;
OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ; OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
SetBackground(MacGetBackgroundBrush(window));
#endif #endif
SetBackground(MacGetBackgroundBrush(window));
SetFont( window->GetFont() ) ; SetFont( window->GetFont() ) ;
} }
@@ -203,7 +201,6 @@ wxClientDC::wxClientDC(wxWindow *window)
m_graphicContext->SetPen( m_pen ) ; m_graphicContext->SetPen( m_pen ) ;
m_graphicContext->SetBrush( m_brush ) ; m_graphicContext->SetBrush( m_brush ) ;
SetClippingRegion( 0 , 0 , size.x , size.y ) ; SetClippingRegion( 0 , 0 , size.x , size.y ) ;
SetBackground(MacGetBackgroundBrush(window));
} }
else else
{ {