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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
24 #include "wx/window.h"
26 #include "wx/bitmap.h"
27 #include "wx/dcmemory.h"
32 #include "wx/settings.h"
33 #include "wx/ownerdrw.h"
34 #include "wx/menuitem.h"
35 #include "wx/fontutil.h"
36 #include "wx/module.h"
40 class wxMSWSystemMenuFontModule
: public wxModule
46 ms_systemMenuFont
= new wxFont
;
52 delete ms_systemMenuFont
;
53 ms_systemMenuFont
= NULL
;
56 static wxFont
* ms_systemMenuFont
;
57 static int ms_systemMenuButtonWidth
; // windows clean install default
58 static int ms_systemMenuHeight
; // windows clean install default
60 DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule
)
63 // these static variables are by the wxMSWSystemMenuFontModule object
64 // and reflect the system settings returned by the Win32 API's
65 // SystemParametersInfo() call.
67 wxFont
* wxMSWSystemMenuFontModule::ms_systemMenuFont
= NULL
;
68 int wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth
= 18; // windows clean install default
69 int wxMSWSystemMenuFontModule::ms_systemMenuHeight
= 18; // windows clean install default
71 IMPLEMENT_DYNAMIC_CLASS(wxMSWSystemMenuFontModule
, wxModule
)
73 // ============================================================================
74 // implementation of wxOwnerDrawn class
75 // ============================================================================
79 wxOwnerDrawn::wxOwnerDrawn(const wxString
& str
,
80 bool bCheckable
, bool bMenuItem
)
86 // these items will be set during the first invocation of the c'tor,
87 // because the values will be determined by checking the system settings,
88 // which is a chunk of code
89 size_t wxOwnerDrawn::ms_nDefaultMarginWidth
= 0;
90 size_t wxOwnerDrawn::ms_nLastMarginWidth
= 0;
96 // get size of the item
97 // The item size includes the menu string, the accel string,
98 // the bitmap and size for a submenu expansion arrow...
99 bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth
, size_t *pheight
)
105 bool wxOwnerDrawn::OnDrawItem(wxDC
& dc
,
114 #endif // wxUSE_OWNER_DRAWN