]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/uma.cpp
applied correction from Marc Newsam in calculations of linesize
[wxWidgets.git] / src / mac / carbon / uma.cpp
index 6eea3bd0628c8c0f272a0fff56497077b95feac9..13d4e27883df0d9a5d86c35ef7fa638130295eac 100644 (file)
@@ -1,9 +1,10 @@
 #include "wx/defs.h"
 #include "wx/defs.h"
+#include "wx/dc.h"
 #include "wx/mac/uma.h"
 #include "wx/mac/aga.h"
 
 #ifdef __UNIX__
 #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
 #else
   #include <Navigation.h>
 #endif
@@ -80,10 +81,14 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
 #endif
                
 #ifndef __UNIX__
 #endif
                
 #ifndef __UNIX__
+#if TARGET_CARBON
+// Call currently implicitely done :           InitFloatingWindows() ;
+#else
        if ( sUMAHasWindowManager )
                InitFloatingWindows() ;
        else
                InitWindows();
        if ( sUMAHasWindowManager )
                InitFloatingWindows() ;
        else
                InitWindows();
+#endif
 #endif
 
        if ( NavServicesAvailable() )
 #endif
 
        if ( NavServicesAvailable() )
@@ -663,11 +668,11 @@ void UMAHideControl                                               (ControlHandle                  theControl)
 {
        if ( UMAHasAppearance() )
        {
 {
        if ( UMAHasAppearance() )
        {
-       ::HideControl( theControl ) ;
+               ::HideControl( theControl ) ;
    }
    else
    {
    }
    else
    {
-       ::HideControl( theControl ) ;
+               ::HideControl( theControl ) ;
    }
 }
 
    }
 }
 
@@ -830,6 +835,7 @@ OSErr UMASetKeyboardFocus                           (WindowPtr                              inWindow,
        }
 #endif
        SetPort( port ) ;
        }
 #endif
        SetPort( port ) ;
+       wxDC::MacInvalidateSetup() ;
        return err ;
 }
 
        return err ;
 }
 
@@ -1354,16 +1360,26 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
        {
 //             bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
 //             if ( inActivate != isHightlited )
        {
 //             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 ) ;
+               wxDC::MacInvalidateSetup() ;
        }
 }
 OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) 
        }
 }
 OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )