]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/uma.cpp
Implemented wxStaticLine under Mac. I thought I had
[wxWidgets.git] / src / mac / carbon / uma.cpp
index f95b4c52bd0425d79cc228e962f2fdebd140d47f..f34db6bc39a87e40076949b9f6af275ea26b00e6 100644 (file)
@@ -1,8 +1,12 @@
-#include <wx/mac/uma.h>
-#include <wx/mac/aga.h>
+#include "wx/defs.h"
+#include "wx/mac/uma.h"
+#include "wx/mac/aga.h"
 
-
-#include "Navigation.h"
+#ifdef __UNIX__
+  #include <NavigationServices/Navigation.h>
+#else
+  #include <Navigation.h>
+#endif
 
 // init
 
@@ -75,10 +79,16 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
 #endif // UMA_USE_WINDOWMGR
 #endif
                
+#ifndef __UNIX__
+#if TARGET_CARBON
+// Call currently implicitely done :           InitFloatingWindows() ;
+#else
        if ( sUMAHasWindowManager )
                InitFloatingWindows() ;
        else
                InitWindows();
+#endif
+#endif
 
        if ( NavServicesAvailable() )
        {
@@ -387,13 +397,22 @@ void                      UMASetWTitleC( WindowRef inWindowRef , const char *title )
        Str255  ptitle ;
        strncpy( (char*)ptitle , title , 96 ) ;
        ptitle[96] = 0 ;
+#if TARGET_CARBON
+       c2pstrcpy( ptitle, (char *)ptitle ) ;
+#else
        c2pstr( (char*)ptitle ) ;
+#endif
        SetWTitle( inWindowRef , ptitle ) ;
 }
+
 void                   UMAGetWTitleC( WindowRef inWindowRef , char *title ) 
 {
        GetWTitle( inWindowRef , (unsigned char*)title ) ;
+#if TARGET_CARBON
+       p2cstrcpy( title, (unsigned char *)title ) ;
+#else
        p2cstr( (unsigned char*)title ) ;
+#endif
 }
 
 void                   UMAShowWindow( WindowRef inWindowRef ) 
@@ -648,11 +667,11 @@ void UMAHideControl                                               (ControlHandle                  theControl)
 {
        if ( UMAHasAppearance() )
        {
-       ::HideControl( theControl ) ;
+               ::HideControl( theControl ) ;
    }
    else
    {
-       ::HideControl( theControl ) ;
+               ::HideControl( theControl ) ;
    }
 }
 
@@ -815,6 +834,7 @@ OSErr UMASetKeyboardFocus                           (WindowPtr                              inWindow,
        }
 #endif
        SetPort( port ) ;
+       wxDC::MacInvalidateSetup() ;
        return err ;
 }
 
@@ -1339,33 +1359,43 @@ 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 ) ;
+               wxDC::MacInvalidateSetup() ;
        }
 }
 OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) 
 {
 #if UMA_USE_APPEARANCE
-       if ( UMAHasAppearance() )
-       {
-               ::DrawThemePlacard( inRect , inState ) ;
-   }
-   else
+  if ( UMAHasAppearance() )
+  {
+    ::DrawThemePlacard( inRect , inState ) ;
+  }
+  else
 #endif
 #if !TARGET_CARBON
-   {
-   }
+  {
+  }
 #else
-       {
-       }
+  {
+  }
 #endif
 }