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