From: Stefan Csomor Date: Fri, 28 Dec 2001 19:17:59 +0000 (+0000) Subject: cleaned drawing code X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a5a8ff8aab0fd27201ed8d07c17bf1a16aabfc93 cleaned drawing code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index 55263a3a6b..946d01f263 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -332,6 +332,7 @@ void wxControl::MacPostControlCreate() SetSize(pos.x, pos.y, new_size.x, new_size.y); UMAShowControl( m_macControl ) ; + Refresh() ; } void wxControl::MacAdjustControlRect() @@ -647,28 +648,8 @@ void wxControl::MacRedrawControl() wxMacDrawingHelper help( win ) ; // the mac control manager always assumes to have the origin at 0,0 SetOrigin( 0 , 0 ) ; - - wxWindow* parent = GetParent() ; - while ( parent ) - { - if( parent->IsTopLevel() ) - { - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ; - break ; - } - - if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) )) - { - if ( ((wxControl*)parent)->m_macControl ) - SetUpControlBackground( ((wxControl*)parent)->m_macControl , -1 , true ) ; - break ; - } - - parent = parent->GetParent() ; - } - + wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; UMADrawControl( m_macControl ) ; - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; } } } @@ -687,36 +668,14 @@ void wxControl::OnPaint(wxPaintEvent& event) wxMacDrawingHelper help( win ) ; // the mac control manager always assumes to have the origin at 0,0 SetOrigin( 0 , 0 ) ; - - /* - wxWindow* parent = GetParent() ; - while ( parent ) - { - if( parent->IsTopLevel() ) - { - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ; - break ; - } - - if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) )) - { - if ( ((wxControl*)parent)->m_macControl ) - SetUpControlBackground( ((wxControl*)parent)->m_macControl , -1 , true ) ; - break ; - } - - parent = parent->GetParent() ; - } - */ - SetUpControlBackground( m_macControl , -1 , true ) ; + wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; UMADrawControl( m_macControl ) ; - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; } } } else { - // wxWindow::OnPaint( event ) ; + event.Skip() ; } } void wxControl::OnEraseBackground(wxEraseEvent& event) diff --git a/src/mac/control.cpp b/src/mac/control.cpp index 55263a3a6b..946d01f263 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -332,6 +332,7 @@ void wxControl::MacPostControlCreate() SetSize(pos.x, pos.y, new_size.x, new_size.y); UMAShowControl( m_macControl ) ; + Refresh() ; } void wxControl::MacAdjustControlRect() @@ -647,28 +648,8 @@ void wxControl::MacRedrawControl() wxMacDrawingHelper help( win ) ; // the mac control manager always assumes to have the origin at 0,0 SetOrigin( 0 , 0 ) ; - - wxWindow* parent = GetParent() ; - while ( parent ) - { - if( parent->IsTopLevel() ) - { - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ; - break ; - } - - if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) )) - { - if ( ((wxControl*)parent)->m_macControl ) - SetUpControlBackground( ((wxControl*)parent)->m_macControl , -1 , true ) ; - break ; - } - - parent = parent->GetParent() ; - } - + wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; UMADrawControl( m_macControl ) ; - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; } } } @@ -687,36 +668,14 @@ void wxControl::OnPaint(wxPaintEvent& event) wxMacDrawingHelper help( win ) ; // the mac control manager always assumes to have the origin at 0,0 SetOrigin( 0 , 0 ) ; - - /* - wxWindow* parent = GetParent() ; - while ( parent ) - { - if( parent->IsTopLevel() ) - { - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ; - break ; - } - - if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) )) - { - if ( ((wxControl*)parent)->m_macControl ) - SetUpControlBackground( ((wxControl*)parent)->m_macControl , -1 , true ) ; - break ; - } - - parent = parent->GetParent() ; - } - */ - SetUpControlBackground( m_macControl , -1 , true ) ; + wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ; UMADrawControl( m_macControl ) ; - // ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; } } } else { - // wxWindow::OnPaint( event ) ; + event.Skip() ; } } void wxControl::OnEraseBackground(wxEraseEvent& event)