]> git.saurik.com Git - wxWidgets.git/blob - src/os2/gdiobj.cpp
moved IMPLEMENT_DYNAMIC_CLASS(wxGDIObject,wxObject) line to gdicmn.cpp so that we...
[wxWidgets.git] / src / os2 / gdiobj.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/os2/gdiobj.cpp
3 // Purpose: wxGDIObject class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13
14 #include "wx/gdiobj.h"
15
16 #ifndef WX_PRECOMP
17 #include "wx/font.h"
18 #include "wx/gdicmn.h"
19 #endif
20
21 class wxStockGDIPM: public wxStockGDI
22 {
23 public:
24 wxStockGDIPM();
25
26 virtual const wxFont* GetFont(Item item);
27
28 private:
29 typedef wxStockGDI super;
30 };
31
32 static wxStockGDIPM gs_wxStockGDIPM_instance;
33
34 wxStockGDIPM::wxStockGDIPM()
35 {
36 // Override default instance
37 ms_instance = this;
38 }
39
40 const wxFont* wxStockGDIPM::GetFont(Item item)
41 {
42 wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]);
43 if (font == NULL)
44 {
45 const int fontSize = 12;
46 switch (item)
47 {
48 case FONT_NORMAL:
49 font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxBOLD);
50 break;
51 case FONT_SMALL:
52 font = new wxFont(fontSize - 4, wxSWISS, wxNORMAL, wxNORMAL);
53 break;
54 default:
55 font = wx_const_cast(wxFont*, super::GetFont(item));
56 break;
57 }
58 ms_stockObject[item] = font;
59 }
60 return font;
61 }