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"
29 #include "wx/ownerdrw.h"
30 #include "wx/menuitem.h"
31 #include "wx/fontutil.h"
32 #include "wx/module.h"
36 class wxMSWSystemMenuFontModule
: public wxModule
42 ms_systemMenuFont
= new wxFont
;
48 delete ms_systemMenuFont
;
49 ms_systemMenuFont
= NULL
;
52 static wxFont
* ms_systemMenuFont
;
53 static int ms_systemMenuButtonWidth
; // windows clean install default
54 static int ms_systemMenuHeight
; // windows clean install default
56 DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule
)
59 // these static variables are by the wxMSWSystemMenuFontModule object
60 // and reflect the system settings returned by the Win32 API's
61 // SystemParametersInfo() call.
63 wxFont
* wxMSWSystemMenuFontModule::ms_systemMenuFont
= NULL
;
64 int wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth
= 18; // windows clean install default
65 int wxMSWSystemMenuFontModule::ms_systemMenuHeight
= 18; // windows clean install default
67 IMPLEMENT_DYNAMIC_CLASS(wxMSWSystemMenuFontModule
, wxModule
)
69 // ============================================================================
70 // implementation of wxOwnerDrawn class
71 // ============================================================================
75 wxOwnerDrawn::wxOwnerDrawn(const wxString
& str
,
76 bool bCheckable
, bool bMenuItem
)
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
85 size_t wxOwnerDrawn::ms_nDefaultMarginWidth
= 0;
86 size_t wxOwnerDrawn::ms_nLastMarginWidth
= 0;
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...
95 bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth
, size_t *pheight
)
101 bool wxOwnerDrawn::OnDrawItem(wxDC
& dc
,
110 #endif // wxUSE_OWNER_DRAWN