]> git.saurik.com Git - wxWidgets.git/blob - src/os2/gdiobj.cpp
Drawing fixed according to patch #1523304.
[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 IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
22
23 class wxStockGDIPM: public wxStockGDI
24 {
25 public:
26 wxStockGDIPM();
27
28 virtual const wxFont* GetFont(Item item);
29
30 private:
31 typedef wxStockGDI super;
32 };
33
34 static wxStockGDIPM gs_wxStockGDIPM_instance;
35
36 wxStockGDIPM::wxStockGDIPM()
37 {
38 // Override default instance
39 ms_instance = this;
40 }
41
42 const wxFont* wxStockGDIPM::GetFont(Item item)
43 {
44 wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]);
45 if (font == NULL)
46 {
47 const int fontSize = 12;
48 switch (item)
49 {
50 case FONT_NORMAL:
51 font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxBOLD);
52 break;
53 case FONT_SMALL:
54 font = new wxFont(fontSize - 4, wxSWISS, wxNORMAL, wxNORMAL);
55 break;
56 default:
57 font = wx_const_cast(wxFont*, super::GetFont(item));
58 break;
59 }
60 ms_stockObject[item] = font;
61 }
62 return font;
63 }