corrected positioning of focus rect in hierarchies and changed the redraw after a control lost focus to do an invalidation instead of a redraw, because in the situations where we have wrong z-order (static boxes) a wrong shade of gray will get painted otherwise.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d0247e6729
commit
101634b2e4
@ -2429,8 +2429,22 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event)
|
||||
else
|
||||
{
|
||||
DrawThemeFocusRect( &rect , false ) ;
|
||||
|
||||
// as this erases part of the frame we have to redraw borders
|
||||
MacPaintBorders( x , y ) ;
|
||||
// and because our z-ordering is not always correct (staticboxes)
|
||||
// we have to invalidate things, we cannot simple redraw
|
||||
RgnHandle updateInner = NewRgn() , updateOuter = NewRgn() ;
|
||||
RectRgn( updateInner , &rect ) ;
|
||||
InsetRect( &rect , -4 , -4 ) ;
|
||||
RectRgn( updateOuter , &rect ) ;
|
||||
DiffRgn( updateOuter , updateInner ,updateOuter ) ;
|
||||
wxPoint parent(0,0);
|
||||
GetParent()->MacWindowToRootWindow( &parent.x , &parent.y ) ;
|
||||
parent -= GetParent()->GetClientAreaOrigin() ;
|
||||
OffsetRgn( updateOuter , -parent.x , -parent.y ) ;
|
||||
GetParent()->m_peer->SetNeedsDisplay( true , updateOuter ) ;
|
||||
DisposeRgn(updateOuter) ;
|
||||
DisposeRgn(updateInner) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2726,6 +2740,7 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
|
||||
wxWindowDC dc(this) ;
|
||||
dc.SetClippingRegion(wxRegion(updatergn));
|
||||
wxMacPortSetter helper(&dc) ;
|
||||
OffsetRect( &childRect , dc.m_macLocalOrigin.x , dc.m_macLocalOrigin.y ) ;
|
||||
DrawThemeFocusRect( &childRect , true ) ;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user