]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/gdiobj.cpp
Misplaced #ifdef ... #endif fix.
[wxWidgets.git] / src / mac / carbon / gdiobj.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: gdiobj.cpp
3// Purpose: wxGDIObject class
a31a5f85 4// Author: Stefan Csomor
e9576ca5 5// Modified by:
a31a5f85 6// Created: 1998-01-01
e9576ca5 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
3d1a4878
SC
12#include "wx/wxprec.h"
13
e9576ca5 14#include "wx/gdiobj.h"
f516d986
VZ
15#include "wx/gdicmn.h"
16#include "wx/mac/private.h"
e9576ca5 17
e9576ca5 18IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
e9576ca5 19
f516d986
VZ
20class wxStockGDIMac: public wxStockGDI
21{
22public:
23 wxStockGDIMac();
24
25 virtual const wxFont* GetFont(Item item);
26
27private:
28 typedef wxStockGDI super;
29};
30
31static wxStockGDIMac gs_wxStockGDIMac_instance;
32
33wxStockGDIMac::wxStockGDIMac()
34{
35 // Override default instance
36 ms_instance = this;
37}
38
39const 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}