]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/statbrma.cpp
removing unnecessary invalidation in Update, adding a forced update to ScrollWindow...
[wxWidgets.git] / src / mac / carbon / statbrma.cpp
index 29131affcd0bef46111b659e081dae41ec346a42..f7b7ad477f3192bb738bdcc693b71311c495ebbe 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Stefan Csomor
-// Licence:     wxWindows licence
+// Licence:     wxWidgets licence
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -27,6 +27,7 @@ END_EVENT_TABLE()
 
 #ifdef __WXMAC__
 #include "wx/mac/private.h"
+#include "wx/toplevel.h"
 #endif
 
 // ============================================================================
@@ -67,7 +68,7 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
     wxRect rect;
     GetFieldRect(i, rect);
     
-    if ( !MacGetTopLevelWindow()->MacGetMetalAppearance() && !IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) )
+    if ( !MacIsReallyHilited()  )
     {
         dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
     }
@@ -79,8 +80,11 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
     dc.GetTextExtent(text, &x, &y);
     
     int xpos = rect.x + leftMargin + 1 ;
-    int ypos = 2 ;
+    int ypos = 1 ;
     
+    if ( MacGetTopLevelWindow()->MacGetMetalAppearance()  )
+        ypos++ ;
+        
     dc.SetClippingRegion(rect.x, 0, rect.width, h);
     
     dc.DrawText(text, xpos, ypos);
@@ -119,7 +123,7 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
     int w, h ;
     GetSize( &w , &h ) ;
 
-       if ( IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) || MacGetTopLevelWindow()->MacGetMetalAppearance() )
+       if ( MacIsReallyHilited() )
        {
                wxPen white( wxWHITE , 1 , wxSOLID ) ;
         if (major >= 10 ) 
@@ -161,3 +165,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
        for ( i = 0; i < m_nFields; i ++ )
                DrawField(dc, i);
 }
+
+void wxStatusBarMac::MacHiliteChanged()
+{
+    Refresh() ;
+    Update() ;
+}