]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/gdiobj.cpp
added SetDoubleBuffered() (patch 1491093)
[wxWidgets.git] / src / os2 / gdiobj.cpp
index 63697c835427fdea399f1bf61d3a3b046d4af9c9..699e33d4505f020809cb4cd93f50cbe2182b278a 100644 (file)
@@ -1,22 +1,60 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        gdiobj.cpp
+// Name:        src/os2/gdiobj.cpp
 // Purpose:     wxGDIObject class
 // Author:      AUTHOR
 // Modified by:
 // Created:     ??/??/98
 // RCS-ID:      $Id$
 // Copyright:   (c) AUTHOR
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "gdiobj.h"
-#endif
+#include "wx/wxprec.h"
 
 #include "wx/gdiobj.h"
+#include "wx/gdicmn.h"
+#include "wx/font.h"
 
-#if !USE_SHARED_LIBRARIES
 IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
-#endif
 
-// TODO: Nothing to do, unless you want to.
+class wxStockGDIPM: public wxStockGDI
+{
+public:
+    wxStockGDIPM();
+
+    virtual const wxFont* GetFont(Item item);
+
+private:
+    typedef wxStockGDI super;
+};
+
+static wxStockGDIPM gs_wxStockGDIPM_instance;
+
+wxStockGDIPM::wxStockGDIPM()
+{
+    // Override default instance
+    ms_instance = this;
+}
+
+const wxFont* wxStockGDIPM::GetFont(Item item)
+{
+    wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]);
+    if (font == NULL)
+    {
+        const int fontSize = 12;
+        switch (item)
+        {
+        case FONT_NORMAL:
+            font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxBOLD);
+            break;
+        case FONT_SMALL:
+            font = new wxFont(fontSize - 4, wxSWISS, wxNORMAL, wxNORMAL);
+            break;
+        default:
+            font = wx_const_cast(wxFont*, super::GetFont(item));
+            break;
+        }
+        ms_stockObject[item] = font;
+    }
+    return font;
+}