// Destructor
wxWindow::~wxWindow()
{
+ // deleting a window while it is shown invalidates the region
+ if ( IsShown() ) {
+ wxWindow* iter = this ;
+ while( iter ) {
+ if ( iter->m_macWindowData )
+ {
+ Refresh() ;
+ break ;
+ }
+ iter = iter->GetParent() ;
+
+ }
+ }
+
m_isBeingDeleted = TRUE;
if ( s_lastMouseWindow == this )
if ( focus.Ok() )
{
Rect clientrect = { 0 , 0 , m_height , m_width } ;
- ClipRect( &clientrect ) ;
+ // ClipRect( &clientrect ) ;
InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
}
}
if ( focus.Ok() )
{
Rect clientrect = { 0 , 0 , m_height , m_width } ;
- ClipRect( &clientrect ) ;
+ // ClipRect( &clientrect ) ;
InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
}
}
}
MacSuperShown( show ) ;
Refresh() ;
- if(m_macWindowData)
- MacUpdateImmediately() ;
return TRUE;
}
void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
{
+// if ( !IsShown() )
+// return ;
+
wxMacDrawingHelper focus( this ) ;
if ( focus.Ok() )
{
Rect clientrect = { 0 , 0 , m_height , m_width } ;
- ClipRect( &clientrect ) ;
+ // ClipRect( &clientrect ) ;
if ( rect )
{
UMACreateRootControl( m_macWindowData->m_macWindow , &m_macWindowData->m_macRootControl ) ;
m_macWindowData->m_macFocus = NULL ;
+ m_macWindowData->m_macHasReceivedFirstActivate = true ;
}
void wxWindow::MacPaint( wxPaintEvent &event )
else
event.SetEventType(wxEVT_LEFT_DCLICK ) ;
}
+ lastWhen = 0 ;
+ }
+ else
+ {
+ lastWhen = ev->when ;
}
- lastWhen = ev->when ;
lastWhere = localwhere ;
}
}
void wxWindow::MacActivate( EventRecord *ev , bool inIsActivating )
{
+ if ( !m_macWindowData->m_macHasReceivedFirstActivate )
+ m_macWindowData->m_macHasReceivedFirstActivate = true ;
+
wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId);
event.m_timeStamp = ev->when ;
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
+ Refresh(false) ;
UMAHighlightAndActivateWindow( m_macWindowData->m_macWindow , inIsActivating ) ;
+// MacUpdateImmediately() ;
}
void wxWindow::MacRedraw( RgnHandle updatergn , long time)
RGBBackColor( &m_backgroundColour.GetPixel()) ;
}
// subtract all non transparent children from updatergn
-
+
RgnHandle childarea = NewRgn() ;
for (wxNode *node = GetChildren().First(); node; node = node->Next())
{
// eventually test for transparent windows
if ( child->GetMacRootWindow() == window && child->IsShown() )
{
- if ( !child->IsKindOf( CLASSINFO( wxNotebook ) ) && !child->IsKindOf( CLASSINFO( wxTabCtrl ) ) )
+ 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 ) ;
GetPortVisibleRegion( GetWindowPort( window ), region );
// if windowshade gives incompatibility , take the follwing out
- if ( !EmptyRgn( region ) )
+ if ( !EmptyRgn( region ) && win->m_macWindowData->m_macHasReceivedFirstActivate )
{
win->MacRedraw( region , wxTheApp->sm_lastMessageTime ) ;
}
GetPortVisibleRegion( GetWindowPort( window ), region );
// if windowshade gives incompatibility , take the follwing out
- if ( !EmptyRgn( region ) )
+ if ( !EmptyRgn( region ) && win->m_macWindowData->m_macHasReceivedFirstActivate )
{
MacRedraw( region , ev->when ) ;
}