]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/settings.cpp
Fix wxLaunchDefaultBrowser on wxMSW for local files/directories: the bug could be...
[wxWidgets.git] / src / osx / carbon / settings.cpp
index ae7625872cfb0f2ae6a2c05248b78b2316e2f351..ad5c4f79873536a64a66a4955691a49b4afdd9d1 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/mac/carbon/settings.cpp
+// Name:        src/osx/carbon/settings.cpp
 // Purpose:     wxSettings
 // Author:      Stefan Csomor
 // Modified by:
@@ -18,7 +18,7 @@
     #include "wx/gdicmn.h"
 #endif
 
-#include "wx/osx/uma.h"
+#include "wx/osx/private.h"
 
 // ----------------------------------------------------------------------------
 // wxSystemSettingsNative
 wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
 {
     wxColour resultColor;
+#if wxOSX_USE_COCOA_OR_CARBON
     ThemeBrush colorBrushID;
+#endif
 
     switch ( index )
     {
         case wxSYS_COLOUR_WINDOW:
-            resultColor = *wxWHITE ;
+#if wxOSX_USE_COCOA_OR_CARBON
+            resultColor = wxColour(wxMacCreateCGColorFromHITheme( 15 /* kThemeBrushDocumentWindowBackground */ )) ;
+#else
+            resultColor = *wxWHITE;
+#endif
             break ;
         case wxSYS_COLOUR_SCROLLBAR :
         case wxSYS_COLOUR_BACKGROUND:
@@ -48,7 +54,11 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_INACTIVEBORDER:
         case wxSYS_COLOUR_BTNFACE:
         case wxSYS_COLOUR_MENUBAR:
-            resultColor = wxColor( 0xDD, 0xDD, 0xDD );
+#if wxOSX_USE_COCOA_OR_CARBON
+            resultColor = wxColour(wxMacCreateCGColorFromHITheme( 3 /* kThemeBrushDialogBackgroundActive */));
+#else
+            resultColor = wxColour( 0xBE, 0xBE, 0xBE ) ;
+#endif
             break ;
 
         case wxSYS_COLOUR_LISTBOX :
@@ -56,7 +66,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
             break ;
 
         case wxSYS_COLOUR_BTNSHADOW:
-            resultColor = wxColor( 0xBE, 0xBE, 0xBE );
+            resultColor = wxColour( 0xBE, 0xBE, 0xBE );
             break ;
 
         case wxSYS_COLOUR_BTNTEXT:
@@ -65,18 +75,23 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_CAPTIONTEXT:
         case wxSYS_COLOUR_INFOTEXT:
         case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
+        case wxSYS_COLOUR_LISTBOXTEXT:
             resultColor = *wxBLACK;
             break ;
 
         case wxSYS_COLOUR_HIGHLIGHT:
             {
+#if wxOSX_USE_COCOA_OR_CARBON
 #if 0
             // NB: enable this case as desired
                 colorBrushID = kThemeBrushAlternatePrimaryHighlightColor;
 #else
-                colorBrushID = kThemeBrushPrimaryHighlightColor;
+                colorBrushID = -3 /* kThemeBrushPrimaryHighlightColor */;
+#endif
+                resultColor = wxColour( wxMacCreateCGColorFromHITheme(colorBrushID) );
+#else
+                resultColor = wxColor( 0xCC, 0xCC, 0xFF );
 #endif
-                resultColor = wxColor( wxMacCreateCGColorFromHITheme(colorBrushID) );
             }
             break ;
 
@@ -94,17 +109,16 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
             break ;
 
         case wxSYS_COLOUR_HIGHLIGHTTEXT :
-#if 0 
-            // NB: enable this case as desired
-            resultColor = *wxWHITE ;
-#else
+#if wxOSX_USE_COCOA_OR_CARBON
             {
-                wxColour highlightcolor( wxMacCreateCGColorFromHITheme(kThemeBrushPrimaryHighlightColor) );
+                wxColour highlightcolor( wxMacCreateCGColorFromHITheme(-3 /* kThemeBrushPrimaryHighlightColor */) );
                 if ((highlightcolor.Red() + highlightcolor.Green()  + highlightcolor.Blue() ) == 0)
                     resultColor = *wxWHITE ;
                 else
                     resultColor = *wxBLACK ;
             }
+#else
+            resultColor = *wxWHITE ;
 #endif
             break ;
 
@@ -227,12 +241,12 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w
         // TODO: case wxSYS_SHOW_SOUNDS:
 
         case wxSYS_DCLICK_MSEC:
-#ifdef __LP64__
+#if wxOSX_USE_CARBON
+            return (int)(GetDblTime() * 1000. / 60.);
+#else
             // default on mac is 30 ticks, we shouldn't really use wxSYS_DCLICK_MSEC anyway 
             // but rather rely on the 'click-count' by the system delivered in a mouse event
             return 500;
-#else
-            return (int)(GetDblTime() * 1000. / 60.);
 #endif
         default:
             // unsupported metric