From 271fa2508353d08b32d9204a94b0016edb9bf84e Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 12 Feb 2005 10:42:00 +0000 Subject: [PATCH] Applied [ 1059554 ] patch for [1028659] fixes a couple of bugs with menus git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/menuitem.cpp | 6 +++++- src/msw/ownerdrw.cpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index e2063200cd..e4a9d1beb9 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -170,9 +170,13 @@ void wxMenuItem::Init() #undef SYS_COLOR - // we don't want normal items be owner-drawn + // setting default colors switched ownerdraw on: switch it off again ResetOwnerDrawn(); + // switch ownerdraw back on if using a non default margin + if ( GetId() != wxID_SEPARATOR ) + SetMarginWidth(GetMarginWidth()); + // tell the owner drawing code to to show the accel string as well SetAccelString(m_text.AfterFirst(_T('\t'))); #endif // wxUSE_OWNER_DRAWN diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index 378f66b95d..4f07892a37 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -107,8 +107,8 @@ wxOwnerDrawn::wxOwnerDrawn(const wxString& str, // menu icons and checkmarks if (ms_nDefaultMarginWidth == 0) { - ms_nDefaultMarginWidth = wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth; - ms_nLastMarginWidth = wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth; + ms_nDefaultMarginWidth = ::GetSystemMetrics(SM_CXMENUCHECK) + wxSystemSettings::GetMetric(wxSYS_EDGE_X); + ms_nLastMarginWidth = ms_nDefaultMarginWidth; } if (wxMSWSystemMenuFontModule::ms_systemMenuFont->Ok() && bMenuItem) -- 2.47.2