]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: gdiobj.cpp | |
3 | // Purpose: wxGDIObject class | |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: ??/??/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
65571936 | 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" |
0e320a79 | 16 | |
0e320a79 | 17 | IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) |
0e320a79 | 18 | |
f516d986 VZ |
19 | class wxStockGDIPM: public wxStockGDI |
20 | { | |
21 | public: | |
22 | wxStockGDIPM(); | |
23 | ||
24 | virtual const wxFont* GetFont(Item item); | |
25 | ||
26 | private: | |
27 | typedef wxStockGDI super; | |
28 | }; | |
29 | ||
30 | static wxStockGDIPM gs_wxStockGDIPM_instance; | |
31 | ||
32 | wxStockGDIPM::wxStockGDIPM() | |
33 | { | |
34 | // Override default instance | |
35 | ms_instance = this; | |
36 | } | |
37 | ||
38 | const wxFont* wxStockGDIPM::GetFont(Item item) | |
39 | { | |
40 | wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]); | |
41 | if (font == NULL) | |
42 | { | |
43 | const int fontSize = 12; | |
44 | switch (item) | |
45 | { | |
46 | case FONT_NORMAL: | |
47 | font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxBOLD); | |
48 | break; | |
49 | case FONT_SMALL: | |
50 | font = new wxFont(fontSize - 4, wxSWISS, wxNORMAL, wxNORMAL); | |
51 | break; | |
52 | default: | |
53 | font = wx_const_cast(wxFont*, super::GetFont(item)); | |
54 | break; | |
55 | } | |
56 | ms_stockObject[item] = font; | |
57 | } | |
58 | return font; | |
59 | } |