]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/settings.cpp
Reapplied some previous patches that got lost while merging the Cocoa implementation
[wxWidgets.git] / src / osx / carbon / settings.cpp
index b2ceb365f1ef81f9bcdadc693f05b7fe5a66ebc0..b7608a7e25375f4edddd2a7171d510a7a6c2be2b 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:
@@ -19,6 +19,7 @@
 #endif
 
 #include "wx/osx/private.h"
+#include "wx/fontenum.h"
 
 // ----------------------------------------------------------------------------
 // wxSystemSettingsNative
@@ -39,7 +40,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
     {
         case wxSYS_COLOUR_WINDOW:
 #if wxOSX_USE_COCOA_OR_CARBON
-            resultColor = wxColour(wxMacCreateCGColorFromHITheme( kThemeBrushDocumentWindowBackground )) ;
+            resultColor = wxColour(wxMacCreateCGColorFromHITheme( 15 /* kThemeBrushDocumentWindowBackground */ )) ;
 #else
             resultColor = *wxWHITE;
 #endif
@@ -55,7 +56,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_BTNFACE:
         case wxSYS_COLOUR_MENUBAR:
 #if wxOSX_USE_COCOA_OR_CARBON
-            resultColor = wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive));
+            resultColor = wxColour(wxMacCreateCGColorFromHITheme( 3 /* kThemeBrushDialogBackgroundActive */));
 #else
             resultColor = wxColour( 0xBE, 0xBE, 0xBE ) ;
 #endif
@@ -75,6 +76,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_CAPTIONTEXT:
         case wxSYS_COLOUR_INFOTEXT:
         case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
+        case wxSYS_COLOUR_LISTBOXTEXT:
             resultColor = *wxBLACK;
             break ;
 
@@ -85,7 +87,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
             // NB: enable this case as desired
                 colorBrushID = kThemeBrushAlternatePrimaryHighlightColor;
 #else
-                colorBrushID = kThemeBrushPrimaryHighlightColor;
+                colorBrushID = -3 /* kThemeBrushPrimaryHighlightColor */;
 #endif
                 resultColor = wxColour( wxMacCreateCGColorFromHITheme(colorBrushID) );
 #else
@@ -110,7 +112,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_HIGHLIGHTTEXT :
 #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
@@ -145,6 +147,8 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
             break ;
     }
 
+    //wxASSERT(resultColor.IsOk());
+
     return resultColor;
 }
 
@@ -154,20 +158,25 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
 
 wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
 {
+    wxFont font;
+    
     switch (index)
     {
         case wxSYS_ANSI_VAR_FONT :
         case wxSYS_SYSTEM_FONT :
         case wxSYS_DEVICE_DEFAULT_FONT :
         case wxSYS_DEFAULT_GUI_FONT :
-            return *wxSMALL_FONT ;
+            font = *wxSMALL_FONT ;
             break ;
 
         default :
+            font = *wxNORMAL_FONT ;
             break ;
     }
 
-    return *wxNORMAL_FONT;
+    //wxASSERT(font.IsOk() && wxFontEnumerator::IsValidFacename(font.GetFaceName()));
+
+    return font;
 }
 
 // ----------------------------------------------------------------------------