]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected positioning of focus rect in hierarchies and changed the redraw after a...
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 6 Aug 2004 18:30:55 +0000 (18:30 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 6 Aug 2004 18:30:55 +0000 (18:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index 4ffbac7e7161850e7188338fce1fca4dd4dc1af6..7e931ec421337fefe9c3006b684486442958c318 100644 (file)
@@ -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 ) ;
             }
         }