]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: gdiobj.cpp | |
3 | // Purpose: wxGDIObject class | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #include "wx/wxprec.h" | |
13 | ||
14 | #include "wx/gdiobj.h" | |
15 | #include "wx/gdicmn.h" | |
16 | #include "wx/mac/private.h" | |
17 | ||
18 | IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) | |
19 | ||
20 | class wxStockGDIMac: public wxStockGDI | |
21 | { | |
22 | public: | |
23 | wxStockGDIMac(); | |
24 | ||
25 | virtual const wxFont* GetFont(Item item); | |
26 | ||
27 | private: | |
28 | typedef wxStockGDI super; | |
29 | }; | |
30 | ||
31 | static wxStockGDIMac gs_wxStockGDIMac_instance; | |
32 | ||
33 | wxStockGDIMac::wxStockGDIMac() | |
34 | { | |
35 | // Override default instance | |
36 | ms_instance = this; | |
37 | } | |
38 | ||
39 | const wxFont* wxStockGDIMac::GetFont(Item item) | |
40 | { | |
41 | wxFont* font = static_cast<wxFont*>(ms_stockObject[item]); | |
42 | if (font == NULL) | |
43 | { | |
44 | switch (item) | |
45 | { | |
46 | case FONT_NORMAL: | |
47 | font = new wxFont; | |
48 | font->MacCreateThemeFont(kThemeSystemFont); | |
49 | break; | |
50 | case FONT_SMALL: | |
51 | font = new wxFont; | |
52 | font->MacCreateThemeFont(kThemeSmallSystemFont); | |
53 | break; | |
54 | default: | |
55 | font = const_cast<wxFont*>(super::GetFont(item)); | |
56 | break; | |
57 | } | |
58 | ms_stockObject[item] = font; | |
59 | } | |
60 | return font; | |
61 | } |