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