X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a31a5f85341a2ef131d86a1dee12f3d6c8156118..0e9c99232fb603fc94ff83f2990720ac91d525a5:/src/mac/carbon/gdiobj.cpp diff --git a/src/mac/carbon/gdiobj.cpp b/src/mac/carbon/gdiobj.cpp index 76bc6a264e..f6c046cc61 100644 --- a/src/mac/carbon/gdiobj.cpp +++ b/src/mac/carbon/gdiobj.cpp @@ -6,17 +6,56 @@ // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "gdiobj.h" -#endif +#include "wx/wxprec.h" #include "wx/gdiobj.h" +#include "wx/gdicmn.h" +#include "wx/mac/private.h" -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) -#endif -// TODO: Nothing to do, unless you want to. +class wxStockGDIMac: public wxStockGDI +{ +public: + wxStockGDIMac(); + + virtual const wxFont* GetFont(Item item); + +private: + typedef wxStockGDI super; +}; + +static wxStockGDIMac gs_wxStockGDIMac_instance; + +wxStockGDIMac::wxStockGDIMac() +{ + // Override default instance + ms_instance = this; +} + +const wxFont* wxStockGDIMac::GetFont(Item item) +{ + wxFont* font = static_cast(ms_stockObject[item]); + if (font == NULL) + { + switch (item) + { + case FONT_NORMAL: + font = new wxFont; + font->MacCreateThemeFont(kThemeSystemFont); + break; + case FONT_SMALL: + font = new wxFont; + font->MacCreateThemeFont(kThemeSmallSystemFont); + break; + default: + font = const_cast(super::GetFont(item)); + break; + } + ms_stockObject[item] = font; + } + return font; +}