]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/uma.cpp
added const for Mac OS X compilation
[wxWidgets.git] / src / mac / carbon / uma.cpp
index 78f6706ac3b50fcda36cd5f1040a8a2c5914d502..19a50536458b87a925c47b4ab50a6c7f15f320f8 100644 (file)
@@ -1,9 +1,10 @@
 #include "wx/defs.h"
+#include "wx/dc.h"
 #include "wx/mac/uma.h"
 #include "wx/mac/aga.h"
 
 #ifdef __UNIX__
-  #include <NavigationServices/Navigation.h>
+  #include <Carbon/Carbon.h>
 #else
   #include <Navigation.h>
 #endif
@@ -667,11 +668,11 @@ void UMAHideControl                                               (ControlHandle                  theControl)
 {
        if ( UMAHasAppearance() )
        {
-       ::HideControl( theControl ) ;
+               ::HideControl( theControl ) ;
    }
    else
    {
-       ::HideControl( theControl ) ;
+               ::HideControl( theControl ) ;
    }
 }
 
@@ -834,7 +835,6 @@ OSErr UMASetKeyboardFocus                           (WindowPtr                              inWindow,
        }
 #endif
        SetPort( port ) ;
-       wxDC::MacInvalidateSetup() ;
        return err ;
 }
 
@@ -1359,16 +1359,25 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
        {
 //             bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
 //             if ( inActivate != isHightlited )
-                               HiliteWindow( inWindowRef , inActivate ) ;
-                               ControlHandle control = NULL ;
-                               UMAGetRootControl( inWindowRef , & control ) ;
-                               if ( control )
-                               {
-                                       if ( inActivate )
-                                               UMAActivateControl( control ) ;
-                                       else
-                                               UMADeactivateControl( control ) ;
-                               }       
+               GrafPtr port ;
+               GetPort( &port ) ;
+#if TARGET_CARBON
+               SetPort( GetWindowPort( inWindowRef ) ) ;
+#else
+               SetPort( inWindowRef ) ;
+#endif
+               SetOrigin( 0 , 0 ) ;
+               HiliteWindow( inWindowRef , inActivate ) ;
+               ControlHandle control = NULL ;
+               UMAGetRootControl( inWindowRef , & control ) ;
+               if ( control )
+               {
+                       if ( inActivate )
+                               UMAActivateControl( control ) ;
+                       else
+                               UMADeactivateControl( control ) ;
+               }       
+               SetPort( port ) ;
        }
 }
 OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )