X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..3184454fc04cf572075c9473535fd07b8f9839c7:/src/os2/gdiobj.cpp?ds=sidebyside diff --git a/src/os2/gdiobj.cpp b/src/os2/gdiobj.cpp index af715606bc..0177d3c82d 100644 --- a/src/os2/gdiobj.cpp +++ b/src/os2/gdiobj.cpp @@ -1,18 +1,63 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.cpp +// Name: src/os2/gdiobj.cpp // Purpose: wxGDIObject class // Author: AUTHOR // Modified by: // Created: ??/??/98 // RCS-ID: $Id$ // Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" #include "wx/gdiobj.h" +#ifndef WX_PRECOMP + #include "wx/font.h" + #include "wx/gdicmn.h" +#endif + IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) -// TODO: Nothing to do, unless you want to. +class wxStockGDIPM: public wxStockGDI +{ +public: + wxStockGDIPM(); + + virtual const wxFont* GetFont(Item item); + +private: + typedef wxStockGDI super; +}; + +static wxStockGDIPM gs_wxStockGDIPM_instance; + +wxStockGDIPM::wxStockGDIPM() +{ + // Override default instance + ms_instance = this; +} + +const wxFont* wxStockGDIPM::GetFont(Item item) +{ + wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]); + if (font == NULL) + { + const int fontSize = 12; + switch (item) + { + case FONT_NORMAL: + font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxBOLD); + break; + case FONT_SMALL: + font = new wxFont(fontSize - 4, wxSWISS, wxNORMAL, wxNORMAL); + break; + default: + font = wx_const_cast(wxFont*, super::GetFont(item)); + break; + } + ms_stockObject[item] = font; + } + return font; +}