]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/gdiobj.cpp
Missing #includes to allow wx/mac/carbon/tooltip.h be included first by user.
[wxWidgets.git] / src / mac / carbon / gdiobj.cpp
index 76bc6a264ea7fb6cc25d338c382f19371339adc7..f6c046cc61d9e61eba6e1d3e3e0b7d62d8ddbb7e 100644 (file)
@@ -6,17 +6,56 @@
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
-// Licence:    wxWindows licence
+// Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "gdiobj.h"
-#endif
+#include "wx/wxprec.h"
 
 #include "wx/gdiobj.h"
 
 #include "wx/gdiobj.h"
+#include "wx/gdicmn.h"
+#include "wx/mac/private.h"
 
 
-#if !USE_SHARED_LIBRARIES
 IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
-#endif
 
 
-// TODO: Nothing to do, unless you want to.
+class wxStockGDIMac: public wxStockGDI
+{
+public:
+    wxStockGDIMac();
+
+    virtual const wxFont* GetFont(Item item);
+
+private:
+    typedef wxStockGDI super;
+};
+
+static wxStockGDIMac gs_wxStockGDIMac_instance;
+
+wxStockGDIMac::wxStockGDIMac()
+{
+    // Override default instance
+    ms_instance = this;
+}
+
+const wxFont* wxStockGDIMac::GetFont(Item item)
+{
+    wxFont* font = static_cast<wxFont*>(ms_stockObject[item]);
+    if (font == NULL)
+    {
+        switch (item)
+        {
+        case FONT_NORMAL:
+            font = new wxFont;
+            font->MacCreateThemeFont(kThemeSystemFont);
+            break;
+        case FONT_SMALL:
+            font = new wxFont;
+            font->MacCreateThemeFont(kThemeSmallSystemFont);
+            break;
+        default:
+            font = const_cast<wxFont*>(super::GetFont(item));
+            break;
+        }
+        ms_stockObject[item] = font;
+    }
+    return font;
+}