]> git.saurik.com Git - wxWidgets.git/blame - src/os2/gdiobj.cpp
don't return items which are not visible from DoHitTest() (patch 1448508)
[wxWidgets.git] / src / os2 / gdiobj.cpp
CommitLineData
0e320a79
DW
1/////////////////////////////////////////////////////////////////////////////
2// Name: gdiobj.cpp
3// Purpose: wxGDIObject class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
65571936 9// Licence: wxWindows licence
0e320a79
DW
10/////////////////////////////////////////////////////////////////////////////
11
0371a691 12#include "wx/wxprec.h"
0e320a79
DW
13
14#include "wx/gdiobj.h"
f516d986 15#include "wx/gdicmn.h"
0e320a79 16
0e320a79 17IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
0e320a79 18
f516d986
VZ
19class wxStockGDIPM: public wxStockGDI
20{
21public:
22 wxStockGDIPM();
23
24 virtual const wxFont* GetFont(Item item);
25
26private:
27 typedef wxStockGDI super;
28};
29
30static wxStockGDIPM gs_wxStockGDIPM_instance;
31
32wxStockGDIPM::wxStockGDIPM()
33{
34 // Override default instance
35 ms_instance = this;
36}
37
38const wxFont* wxStockGDIPM::GetFont(Item item)
39{
40 wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]);
41 if (font == NULL)
42 {
43 const int fontSize = 12;
44 switch (item)
45 {
46 case FONT_NORMAL:
47 font = new wxFont(fontSize, wxMODERN, wxNORMAL, wxBOLD);
48 break;
49 case FONT_SMALL:
50 font = new wxFont(fontSize - 4, wxSWISS, wxNORMAL, wxNORMAL);
51 break;
52 default:
53 font = wx_const_cast(wxFont*, super::GetFont(item));
54 break;
55 }
56 ms_stockObject[item] = font;
57 }
58 return font;
59}