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
This commit is contained in:
Stefan Csomor 2001-02-27 21:38:13 +00:00
parent a22be3e1fc
commit b89dac7816
12 changed files with 20 additions and 126 deletions

View File

@ -2619,6 +2619,7 @@ AGAPortHelper::~AGAPortHelper()
TextMode( mode );
SetOrigin( 0 , 0 ) ;
SetPort( port ) ;
wxDC::MacInvalidateSetup() ;
}
}

View File

@ -2619,6 +2619,7 @@ AGAPortHelper::~AGAPortHelper()
TextMode( mode );
SetOrigin( 0 , 0 ) ;
SetPort( port ) ;
wxDC::MacInvalidateSetup() ;
}
}

View File

@ -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() ;
}
}
}

View File

@ -536,6 +536,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
}
}
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
wxDC::MacInvalidateSetup() ;
}
}
}

View File

@ -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() ;
}
}

View File

@ -834,6 +834,7 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
}
#endif
SetPort( port ) ;
wxDC::MacInvalidateSetup() ;
return err ;
}

View File

@ -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 )
{

View File

@ -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() ;
}
}
}

View File

@ -536,6 +536,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
}
}
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
wxDC::MacInvalidateSetup() ;
}
}
}

View File

@ -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() ;
}
}

View File

@ -834,6 +834,7 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
}
#endif
SetPort( port ) ;
wxDC::MacInvalidateSetup() ;
return err ;
}

View File

@ -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 )
{