]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/ownerdrw.cpp
Italian translation corrections from Roberto Boriotti.
[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 {
5276b0a5 48 wxDELETE(ms_systemMenuFont);
ffecfa5a
JS
49 }
50
51 static wxFont* ms_systemMenuFont;
52 static int ms_systemMenuButtonWidth; // windows clean install default
53 static int ms_systemMenuHeight; // windows clean install default
54private:
55 DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule)
56};
57
58// these static variables are by the wxMSWSystemMenuFontModule object
59// and reflect the system settings returned by the Win32 API's
60// SystemParametersInfo() call.
61
62wxFont* wxMSWSystemMenuFontModule::ms_systemMenuFont = NULL;
63int wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth = 18; // windows clean install default
64int wxMSWSystemMenuFontModule::ms_systemMenuHeight = 18; // windows clean install default
65
66IMPLEMENT_DYNAMIC_CLASS(wxMSWSystemMenuFontModule, wxModule)
67
68// ============================================================================
69// implementation of wxOwnerDrawn class
70// ============================================================================
71
72// ctor
73// ----
74wxOwnerDrawn::wxOwnerDrawn(const wxString& str,
75 bool bCheckable, bool bMenuItem)
76 : m_strName(str)
77{
78}
79
80
81// these items will be set during the first invocation of the c'tor,
82// because the values will be determined by checking the system settings,
83// which is a chunk of code
84size_t wxOwnerDrawn::ms_nDefaultMarginWidth = 0;
85size_t wxOwnerDrawn::ms_nLastMarginWidth = 0;
86
87
88// drawing
89// -------
90
91// get size of the item
92// The item size includes the menu string, the accel string,
93// the bitmap and size for a submenu expansion arrow...
94bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
95{
96 return false;
97}
98
99// draw the item
100bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
101 const wxRect& rc,
102 wxODAction act,
103 wxODStatus st)
104{
105 return false;
106}
107
108
109#endif // wxUSE_OWNER_DRAWN