- RgnHandle childarea = NewRgn() ;
- for (wxNode *node = GetChildren().First(); node; node = node->Next())
- {
- wxWindowMac *child = (wxWindowMac*)node->Data();
- // eventually test for transparent windows
- if ( child->GetMacRootWindow() == window && child->IsShown() )
- {
- if ( child->GetBackgroundColour() != m_backgroundColour && !child->IsKindOf( CLASSINFO( wxControl ) ) && ((wxControl*)child)->GetMacControl() )
- {
- SetRectRgn( childarea , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ;
- DiffRgn( ownUpdateRgn , childarea , ownUpdateRgn ) ;
- }
- }
- }
- DisposeRgn( childarea ) ;
-
- if ( GetParent() && m_backgroundColour != GetParent()->GetBackgroundColour() )
- eraseBackground = true ;
- SetClip( ownUpdateRgn ) ;
- if ( m_macEraseOnRedraw ) {
- if ( eraseBackground )
- {
- EraseRgn( ownUpdateRgn ) ;
- }
- }
- else {
- m_macEraseOnRedraw = true ;
- }
- }
-
- {
- RgnHandle newupdate = NewRgn() ;
- wxSize point = GetClientSize() ;
- wxPoint origin = GetClientAreaOrigin() ;
-
- SetRectRgn( newupdate , origin.x , origin.y , origin.x + point.x , origin.y+point.y ) ;
- SectRgn( newupdate , ownUpdateRgn , newupdate ) ;
- OffsetRgn( newupdate , -origin.x , -origin.y ) ;
- m_updateRegion = newupdate ;
- DisposeRgn( newupdate ) ;
- }
-
- MacPaintBorders() ;
- wxPaintEvent event;
- event.m_timeStamp = time ;
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event);
- }
-
-
- RgnHandle childupdate = NewRgn() ;
-
- for (wxNode *node = GetChildren().First(); node; node = node->Next())
- {
- wxWindowMac *child = (wxWindowMac*)node->Data();
- SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ;
- SectRgn( childupdate , updatergn , childupdate ) ;
- OffsetRgn( childupdate , -child->m_x , -child->m_y ) ;
- if ( child->GetMacRootWindow() == window && child->IsShown() && !EmptyRgn( childupdate ) )
- {
- // because dialogs may also be children
- child->MacRedraw( childupdate , time ) ;
- }
- }
- DisposeRgn( childupdate ) ;
- // eventually a draw grow box here
-}
-
-void wxWindowMac::MacUpdateImmediately()
-{
- WindowRef window = GetMacRootWindow() ;
- if ( window )
- {
- wxWindowMac* win = wxFindWinFromMacWindow( window ) ;
- #if TARGET_CARBON
- AGAPortHelper help( GetWindowPort(window) ) ;
- #else
- AGAPortHelper help( (window) ) ;
- #endif
- SetOrigin( 0 , 0 ) ;
- BeginUpdate( window ) ;
- if ( win )
- {
- RgnHandle region = NewRgn();
-
- if ( region )
- {
- GetPortVisibleRegion( GetWindowPort( window ), region );
-
- // if windowshade gives incompatibility , take the follwing out
- if ( !EmptyRgn( region ) && win->m_macWindowData->m_macHasReceivedFirstActivate )
- {
- win->MacRedraw( region , wxTheApp->sm_lastMessageTime ) ;
- }
- DisposeRgn( region );
- }
- }
- EndUpdate( window ) ;
- }
-}
-
-void wxWindowMac::MacUpdate( EventRecord *ev )
-{
- WindowRef window = (WindowRef) ev->message ;
- wxWindowMac * win = wxFindWinFromMacWindow( window ) ;
- #if TARGET_CARBON
- AGAPortHelper help( GetWindowPort(window) ) ;
- #else
- AGAPortHelper help( (window) ) ;
- #endif
- SetOrigin( 0 , 0 ) ;
- BeginUpdate( window ) ;
- if ( win )
- {
- RgnHandle region = NewRgn();
-
- if ( region )
- {
- GetPortVisibleRegion( GetWindowPort( window ), region );
-
- // if windowshade gives incompatibility , take the follwing out
- if ( !EmptyRgn( region ) && win->m_macWindowData->m_macHasReceivedFirstActivate )