1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/ownerdrw.cpp
3 // Purpose: implementation of wxOwnerDrawn class
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
20 #include "wx/window.h"
22 #include "wx/bitmap.h"
23 #include "wx/dcmemory.h"
26 #include "wx/settings.h"
27 #include "wx/menuitem.h"
28 #include "wx/module.h"
31 #include "wx/ownerdrw.h"
32 #include "wx/fontutil.h"
36 class wxMSWSystemMenuFontModule
: public wxModule
42 ms_systemMenuFont
= new wxFont
;
48 wxDELETE(ms_systemMenuFont
);
51 static wxFont
* ms_systemMenuFont
;
52 static int ms_systemMenuButtonWidth
; // windows clean install default
53 static int ms_systemMenuHeight
; // windows clean install default
55 DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule
)
58 // these static variables are by the wxMSWSystemMenuFontModule object
59 // and reflect the system settings returned by the Win32 API's
60 // SystemParametersInfo() call.
62 wxFont
* wxMSWSystemMenuFontModule::ms_systemMenuFont
= NULL
;
63 int wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth
= 18; // windows clean install default
64 int wxMSWSystemMenuFontModule::ms_systemMenuHeight
= 18; // windows clean install default
66 IMPLEMENT_DYNAMIC_CLASS(wxMSWSystemMenuFontModule
, wxModule
)
68 // ============================================================================
69 // implementation of wxOwnerDrawn class
70 // ============================================================================
74 wxOwnerDrawn::wxOwnerDrawn(const wxString
& str
,
75 bool bCheckable
, bool bMenuItem
)
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
84 size_t wxOwnerDrawn::ms_nDefaultMarginWidth
= 0;
85 size_t wxOwnerDrawn::ms_nLastMarginWidth
= 0;
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...
94 bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth
, size_t *pheight
)
100 bool wxOwnerDrawn::OnDrawItem(wxDC
& dc
,
109 #endif // wxUSE_OWNER_DRAWN