]>
Commit | Line | Data |
---|---|---|
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" | |
dd05139a | 18 | #include "wx/gdicmn.h" |
48a1108e WS |
19 | #endif |
20 | ||
f516d986 VZ |
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 | } |