From: Stefan Csomor Date: Tue, 27 Feb 2001 21:38:13 +0000 (+0000) Subject: added calls for invalidating the dc setup on mac explicitely (needed in case of neste... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b89dac7816168bc86d4862edb394e681c161a3e3 added calls for invalidating the dc setup on mac explicitely (needed in case of nested updates (e.g. writing a message to a text control while being in paint mode) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/aga.cpp b/src/mac/aga.cpp index 0185303bd1..6c24f5ddf8 100644 --- a/src/mac/aga.cpp +++ b/src/mac/aga.cpp @@ -2619,6 +2619,7 @@ AGAPortHelper::~AGAPortHelper() TextMode( mode ); SetOrigin( 0 , 0 ) ; SetPort( port ) ; + wxDC::MacInvalidateSetup() ; } } diff --git a/src/mac/carbon/aga.cpp b/src/mac/carbon/aga.cpp index 0185303bd1..6c24f5ddf8 100644 --- a/src/mac/carbon/aga.cpp +++ b/src/mac/carbon/aga.cpp @@ -2619,6 +2619,7 @@ AGAPortHelper::~AGAPortHelper() TextMode( mode ); SetOrigin( 0 , 0 ) ; SetPort( port ) ; + wxDC::MacInvalidateSetup() ; } } diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index 3e5679a826..0953356de7 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -623,6 +623,7 @@ void wxControl::MacRedrawControl() UMADrawControl( m_macControl ) ; UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; + wxDC::MacInvalidateSetup() ; } } } @@ -664,6 +665,7 @@ void wxControl::OnPaint(wxPaintEvent& event) UMADrawControl( m_macControl ) ; UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; + wxDC::MacInvalidateSetup() ; } } } diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 23dd7761b5..752f71a8cc 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -536,6 +536,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event) } } UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; + wxDC::MacInvalidateSetup() ; } } } diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index ada78751e7..5974c8808e 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -295,6 +295,7 @@ void wxMacToolTip::Draw() ::DrawText( text , laststop , i - laststop ) ; ::TextMode( srcOr ) ; + wxDC::MacInvalidateSetup() ; // DrawText( m_label , 0 , m_label.Length() ) ; } @@ -329,6 +330,7 @@ void wxMacToolTip::Clear() DrawPicture(m_backpict, &m_rect); KillPicture(m_backpict); m_backpict = NULL ; + wxDC::MacInvalidateSetup() ; } } diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index 5c1fbaddb1..78f6706ac3 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -834,6 +834,7 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow, } #endif SetPort( port ) ; + wxDC::MacInvalidateSetup() ; return err ; } diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 6c4f516f71..989141e74c 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -2271,37 +2271,8 @@ long wxWindow::MacRemoveBordersFromStyle( long style ) { return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ; } -/* -wxMacFocusHelper::wxMacFocusHelper( wxWindow * theWindow ) -{ - m_ok = false ; - Point localOrigin ; - Rect clipRect ; - WindowRef window ; - wxWindow *rootwin ; - m_currentPort = NULL ; - GetPort( &m_formerPort ) ; - if ( theWindow ) - { - - theWindow->MacGetPortParams( &localOrigin , &clipRect , &window , &rootwin) ; - m_currentPort = UMAGetWindowPort( window ) ; - theWindow->MacSetPortFocusParams( localOrigin, clipRect, window , rootwin ) ; - m_ok = true ; - } -} - -wxMacFocusHelper::~wxMacFocusHelper() -{ - if ( m_ok ) - { - SetPort( m_currentPort ) ; - SetOrigin( 0 , 0 ) ; - } - if ( m_formerPort != m_currentPort ) - SetPort( m_formerPort ) ; -} -*/ + + wxMacDrawingHelper::wxMacDrawingHelper( wxWindow * theWindow ) { m_ok = false ; @@ -2334,43 +2305,12 @@ wxMacDrawingHelper::~wxMacDrawingHelper() Rect portRect ; GetPortBounds( m_currentPort , &portRect ) ; ClipRect( &portRect ) ; + wxDC::MacInvalidateSetup() ; } if ( m_formerPort != m_currentPort ) SetPort( m_formerPort ) ; } -/* -wxMacFocusClientHelper::wxMacFocusClientHelper( wxWindow * theWindow ) -{ - m_ok = false ; - Point localOrigin ; - Rect clipRect ; - WindowRef window ; - wxWindow *rootwin ; - m_currentPort = NULL ; - - GetPort( &m_formerPort ) ; - - if ( theWindow ) - { - theWindow->MacGetPortClientParams( &localOrigin , &clipRect , &window , &rootwin) ; - m_currentPort = UMAGetWindowPort( window ) ; - theWindow->MacSetPortFocusParams( localOrigin, clipRect, window , rootwin ) ; - m_ok = true ; - } -} - -wxMacFocusClientHelper::~wxMacFocusClientHelper() -{ - if ( m_ok ) - { - SetPort( m_currentPort ) ; - SetOrigin( 0 , 0 ) ; - } - if ( m_formerPort != m_currentPort ) - SetPort( m_formerPort ) ; -} -*/ wxMacDrawingClientHelper::wxMacDrawingClientHelper( wxWindow * theWindow ) { diff --git a/src/mac/control.cpp b/src/mac/control.cpp index 3e5679a826..0953356de7 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -623,6 +623,7 @@ void wxControl::MacRedrawControl() UMADrawControl( m_macControl ) ; UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; + wxDC::MacInvalidateSetup() ; } } } @@ -664,6 +665,7 @@ void wxControl::OnPaint(wxPaintEvent& event) UMADrawControl( m_macControl ) ; UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; + wxDC::MacInvalidateSetup() ; } } } diff --git a/src/mac/toolbar.cpp b/src/mac/toolbar.cpp index 23dd7761b5..752f71a8cc 100644 --- a/src/mac/toolbar.cpp +++ b/src/mac/toolbar.cpp @@ -536,6 +536,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event) } } UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; + wxDC::MacInvalidateSetup() ; } } } diff --git a/src/mac/tooltip.cpp b/src/mac/tooltip.cpp index ada78751e7..5974c8808e 100644 --- a/src/mac/tooltip.cpp +++ b/src/mac/tooltip.cpp @@ -295,6 +295,7 @@ void wxMacToolTip::Draw() ::DrawText( text , laststop , i - laststop ) ; ::TextMode( srcOr ) ; + wxDC::MacInvalidateSetup() ; // DrawText( m_label , 0 , m_label.Length() ) ; } @@ -329,6 +330,7 @@ void wxMacToolTip::Clear() DrawPicture(m_backpict, &m_rect); KillPicture(m_backpict); m_backpict = NULL ; + wxDC::MacInvalidateSetup() ; } } diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index 5c1fbaddb1..78f6706ac3 100644 --- a/src/mac/uma.cpp +++ b/src/mac/uma.cpp @@ -834,6 +834,7 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow, } #endif SetPort( port ) ; + wxDC::MacInvalidateSetup() ; return err ; } diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 6c4f516f71..989141e74c 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -2271,37 +2271,8 @@ long wxWindow::MacRemoveBordersFromStyle( long style ) { return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ; } -/* -wxMacFocusHelper::wxMacFocusHelper( wxWindow * theWindow ) -{ - m_ok = false ; - Point localOrigin ; - Rect clipRect ; - WindowRef window ; - wxWindow *rootwin ; - m_currentPort = NULL ; - GetPort( &m_formerPort ) ; - if ( theWindow ) - { - - theWindow->MacGetPortParams( &localOrigin , &clipRect , &window , &rootwin) ; - m_currentPort = UMAGetWindowPort( window ) ; - theWindow->MacSetPortFocusParams( localOrigin, clipRect, window , rootwin ) ; - m_ok = true ; - } -} - -wxMacFocusHelper::~wxMacFocusHelper() -{ - if ( m_ok ) - { - SetPort( m_currentPort ) ; - SetOrigin( 0 , 0 ) ; - } - if ( m_formerPort != m_currentPort ) - SetPort( m_formerPort ) ; -} -*/ + + wxMacDrawingHelper::wxMacDrawingHelper( wxWindow * theWindow ) { m_ok = false ; @@ -2334,43 +2305,12 @@ wxMacDrawingHelper::~wxMacDrawingHelper() Rect portRect ; GetPortBounds( m_currentPort , &portRect ) ; ClipRect( &portRect ) ; + wxDC::MacInvalidateSetup() ; } if ( m_formerPort != m_currentPort ) SetPort( m_formerPort ) ; } -/* -wxMacFocusClientHelper::wxMacFocusClientHelper( wxWindow * theWindow ) -{ - m_ok = false ; - Point localOrigin ; - Rect clipRect ; - WindowRef window ; - wxWindow *rootwin ; - m_currentPort = NULL ; - - GetPort( &m_formerPort ) ; - - if ( theWindow ) - { - theWindow->MacGetPortClientParams( &localOrigin , &clipRect , &window , &rootwin) ; - m_currentPort = UMAGetWindowPort( window ) ; - theWindow->MacSetPortFocusParams( localOrigin, clipRect, window , rootwin ) ; - m_ok = true ; - } -} - -wxMacFocusClientHelper::~wxMacFocusClientHelper() -{ - if ( m_ok ) - { - SetPort( m_currentPort ) ; - SetOrigin( 0 , 0 ) ; - } - if ( m_formerPort != m_currentPort ) - SetPort( m_formerPort ) ; -} -*/ wxMacDrawingClientHelper::wxMacDrawingClientHelper( wxWindow * theWindow ) {