X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9f385aa0f69b8beae385afd3a3ba4ca6f316da40..5e3841bf8069fbcc2b1da3ef36af4f569c604265:/src/msw/menuitem.cpp diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index f7c1bb88cc..74a82794de 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -89,7 +89,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, wxMenu *pSubMenu) : wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu) #if wxUSE_OWNER_DRAWN - , wxOwnerDrawn(GetLabelFromText(text), kind == wxITEM_CHECK) + , wxOwnerDrawn(text, kind == wxITEM_CHECK) #endif // owner drawn { Init(); @@ -104,7 +104,7 @@ wxMenuItem::wxMenuItem(wxMenu *parentMenu, : wxMenuItemBase(parentMenu, id, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL, subMenu) #if wxUSE_OWNER_DRAWN - , wxOwnerDrawn(GetLabelFromText(text), isCheckable) + , wxOwnerDrawn(text, isCheckable) #endif // owner drawn { Init(); @@ -255,7 +255,7 @@ void wxMenuItem::Check(bool check) start, // the first radio group item end, // the last one pos, // the one to check - MF_BYPOSITION | flags) ) + MF_BYPOSITION) ) { wxLogLastError(_T("CheckMenuRadioItem")); } @@ -300,6 +300,10 @@ void wxMenuItem::SetText(const wxString& text) wxMenuItemBase::SetText(text); OWNER_DRAWN_ONLY( wxOwnerDrawn::SetName(text) ); +#if wxUSE_OWNER_DRAWN + // tell the owner drawing code to to show the accel string as well + SetAccelString(text.AfterFirst(_T('\t'))); +#endif HMENU hMenu = GetHMenuOf(m_parentMenu); wxCHECK_RET( hMenu, wxT("menuitem without menu") );