wxNO_FULL_REPAINT_ON_RESIZE implementation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-10-15 16:16:21 +00:00
parent 91ae025ee2
commit e3dbaff33f
4 changed files with 74 additions and 8 deletions

View File

@@ -683,9 +683,13 @@ void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
if ( doResize )
::SizeWindow((WindowRef)m_macWindow, m_width, m_height , true);
// the OS takes care of invalidating and erasing the new area so we only have to
// take care of refreshing for full repaints
if ( !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
Refresh() ;
// the OS takes care of invalidating and erasing the new area
// we have erased the old one
if ( IsKindOf( CLASSINFO( wxFrame ) ) )
{

View File

@@ -605,7 +605,35 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
{
// erase former position
Refresh() ;
bool partialRepaint = false ;
if ( HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
{
wxPoint oldPos( m_x , m_y ) ;
wxPoint newPos( actualX , actualY ) ;
MacWindowToRootWindow( &oldPos.x , &oldPos.y ) ;
MacWindowToRootWindow( &newPos.x , &newPos.y ) ;
if ( oldPos == newPos )
{
partialRepaint = true ;
RgnHandle oldRgn,newRgn,diffRgn ;
oldRgn = NewRgn() ;
newRgn = NewRgn() ;
diffRgn = NewRgn() ;
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
DiffRgn( newRgn , oldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DiffRgn( oldRgn , newRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DisposeRgn(oldRgn) ;
DisposeRgn(newRgn) ;
DisposeRgn(diffRgn) ;
}
}
if ( !partialRepaint )
Refresh() ;
m_x = actualX ;
m_y = actualY ;
@@ -617,7 +645,8 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
MacUpdateDimensions() ;
// erase new position
Refresh() ;
if ( !partialRepaint )
Refresh() ;
if ( doMove )
wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified

View File

@@ -683,9 +683,13 @@ void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
if ( doResize )
::SizeWindow((WindowRef)m_macWindow, m_width, m_height , true);
// the OS takes care of invalidating and erasing the new area so we only have to
// take care of refreshing for full repaints
if ( !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
Refresh() ;
// the OS takes care of invalidating and erasing the new area
// we have erased the old one
if ( IsKindOf( CLASSINFO( wxFrame ) ) )
{

View File

@@ -605,7 +605,35 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
{
// erase former position
Refresh() ;
bool partialRepaint = false ;
if ( HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
{
wxPoint oldPos( m_x , m_y ) ;
wxPoint newPos( actualX , actualY ) ;
MacWindowToRootWindow( &oldPos.x , &oldPos.y ) ;
MacWindowToRootWindow( &newPos.x , &newPos.y ) ;
if ( oldPos == newPos )
{
partialRepaint = true ;
RgnHandle oldRgn,newRgn,diffRgn ;
oldRgn = NewRgn() ;
newRgn = NewRgn() ;
diffRgn = NewRgn() ;
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
DiffRgn( newRgn , oldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DiffRgn( oldRgn , newRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DisposeRgn(oldRgn) ;
DisposeRgn(newRgn) ;
DisposeRgn(diffRgn) ;
}
}
if ( !partialRepaint )
Refresh() ;
m_x = actualX ;
m_y = actualY ;
@@ -617,7 +645,8 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
MacUpdateDimensions() ;
// erase new position
Refresh() ;
if ( !partialRepaint )
Refresh() ;
if ( doMove )
wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified