]>
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" | |
f516d986 | 15 | #include "wx/gdicmn.h" |
f6630099 | 16 | #include "wx/font.h" |
0e320a79 | 17 | |
0e320a79 | 18 | IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) |
0e320a79 | 19 | |
f516d986 VZ |
20 | class wxStockGDIPM: public wxStockGDI |
21 | { | |
22 | public: | |
23 | wxStockGDIPM(); | |
24 | ||
25 | virtual const wxFont* GetFont(Item item); | |
26 | ||
27 | private: | |
28 | typedef wxStockGDI super; | |
29 | }; | |
30 | ||
31 | static wxStockGDIPM gs_wxStockGDIPM_instance; | |
32 | ||
33 | wxStockGDIPM::wxStockGDIPM() | |
34 | { | |
35 | // Override default instance | |
36 | ms_instance = this; | |
37 | } | |
38 | ||
39 | const wxFont* wxStockGDIPM::GetFont(Item item) | |
40 | { | |
41 | wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]); | |
42 | if (font == NULL) | |
43 | { | |
44 | const int fontSize = 12; | |
45 | switch (item) | |
46 | { | |
47 | case FONT_NORMAL: | |
48 | font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxBOLD); | |
49 | break; | |
50 | case FONT_SMALL: | |
51 | font = new wxFont(fontSize - 4, wxSWISS, wxNORMAL, wxNORMAL); | |
52 | break; | |
53 | default: | |
54 | font = wx_const_cast(wxFont*, super::GetFont(item)); | |
55 | break; | |
56 | } | |
57 | ms_stockObject[item] = font; | |
58 | } | |
59 | return font; | |
60 | } |