]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/ownerdrw.cpp
DC headers don't need to be in gtk/private.h
[wxWidgets.git] / src / palmos / ownerdrw.cpp
CommitLineData
ffecfa5a 1///////////////////////////////////////////////////////////////////////////////
e2731512 2// Name: src/palmos/ownerdrw.cpp
ffecfa5a 3// Purpose: implementation of wxOwnerDrawn class
e2731512 4// Author: William Osborne - minimal working wxPalmOS port
ffecfa5a
JS
5// Modified by:
6// Created: 10/13/04
e2731512 7// RCS-ID: $Id$
ffecfa5a
JS
8// Copyright: (c) William Osborne
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
ffecfa5a
JS
12// For compilers that support precompilation, includes "wx.h".
13#include "wx/wxprec.h"
14
15#ifdef __BORLANDC__
f38924e8 16 #pragma hdrstop
ffecfa5a
JS
17#endif
18
19#ifndef WX_PRECOMP
f38924e8
WS
20 #include "wx/window.h"
21 #include "wx/font.h"
22 #include "wx/bitmap.h"
23 #include "wx/dcmemory.h"
24 #include "wx/menu.h"
25 #include "wx/utils.h"
9eddec69 26 #include "wx/settings.h"
25466131 27 #include "wx/menuitem.h"
02761f6c 28 #include "wx/module.h"
ffecfa5a
JS
29#endif
30
ffecfa5a 31#include "wx/ownerdrw.h"
ffecfa5a 32#include "wx/fontutil.h"
ffecfa5a
JS
33
34#if wxUSE_OWNER_DRAWN
35
36class wxMSWSystemMenuFontModule : public wxModule
37{
38public:
39
40 virtual bool OnInit()
41 {
42 ms_systemMenuFont = new wxFont;
ffecfa5a
JS
43 return true;
44 }
45
46 virtual void OnExit()
47 {
48 delete ms_systemMenuFont;
49 ms_systemMenuFont = NULL;
50 }
51
52 static wxFont* ms_systemMenuFont;
53 static int ms_systemMenuButtonWidth; // windows clean install default
54 static int ms_systemMenuHeight; // windows clean install default
55private:
56 DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule)
57};
58
59// these static variables are by the wxMSWSystemMenuFontModule object
60// and reflect the system settings returned by the Win32 API's
61// SystemParametersInfo() call.
62
63wxFont* wxMSWSystemMenuFontModule::ms_systemMenuFont = NULL;
64int wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth = 18; // windows clean install default
65int wxMSWSystemMenuFontModule::ms_systemMenuHeight = 18; // windows clean install default
66
67IMPLEMENT_DYNAMIC_CLASS(wxMSWSystemMenuFontModule, wxModule)
68
69// ============================================================================
70// implementation of wxOwnerDrawn class
71// ============================================================================
72
73// ctor
74// ----
75wxOwnerDrawn::wxOwnerDrawn(const wxString& str,
76 bool bCheckable, bool bMenuItem)
77 : m_strName(str)
78{
79}
80
81
82// these items will be set during the first invocation of the c'tor,
83// because the values will be determined by checking the system settings,
84// which is a chunk of code
85size_t wxOwnerDrawn::ms_nDefaultMarginWidth = 0;
86size_t wxOwnerDrawn::ms_nLastMarginWidth = 0;
87
88
89// drawing
90// -------
91
92// get size of the item
93// The item size includes the menu string, the accel string,
94// the bitmap and size for a submenu expansion arrow...
95bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
96{
97 return false;
98}
99
100// draw the item
101bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
102 const wxRect& rc,
103 wxODAction act,
104 wxODStatus st)
105{
106 return false;
107}
108
109
110#endif // wxUSE_OWNER_DRAWN