]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/gdiobj.cpp
Fixing inactive state drawing, and removing warning.
[wxWidgets.git] / src / mac / classic / gdiobj.cpp
index 8bd1de31ad28557f20c4cd410d96a608afc6e3c1..4f450527f3d124fcb4830118c47c0c4595e54432 100644 (file)
@@ -1,20 +1,66 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        gdiobj.cpp
+// Name:        src/mac/classic/gdiobj.cpp
 // Purpose:     wxGDIObject class
 // Author:      Stefan Csomor
 // Modified by:
 // 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"
 
-IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
+#ifndef WX_PRECOMP
+    #include "wx/gdicmn.h"
+#endif
+
+#include "wx/mac/private.h"
+
+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;
+}
 
-// TODO: Nothing to do, unless you want to.
+const wxFont* wxStockGDIMac::GetFont(Item item)
+{
+    wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]);
+    if (font == NULL)
+    {
+        Str255 fontName;
+        SInt16 fontSize;
+        Style fontStyle;
+        switch (item)
+        {
+        case FONT_NORMAL:
+            GetThemeFont(kThemeSystemFont, GetApplicationScript(), fontName, &fontSize, &fontStyle);
+            font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxNORMAL, false, wxMacMakeStringFromPascal(fontName));
+            break;
+        case FONT_SMALL:
+            GetThemeFont(kThemeSmallSystemFont, GetApplicationScript(), fontName, &fontSize, &fontStyle);
+            font = new wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL, false, wxMacMakeStringFromPascal(fontName));
+            break;
+        default:
+            font = wx_const_cast(wxFont*, super::GetFont(item));
+            break;
+        }
+        ms_stockObject[item] = font;
+    }
+    return font;
+}