allow calling SetItemLabel() for menu items with NULL menu parent too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -365,6 +365,9 @@ void wxMenuItem::SetItemLabel(const wxString& txt)
|
|||||||
|
|
||||||
// the item can be not attached to any menu yet and SetItemLabel() is still
|
// the item can be not attached to any menu yet and SetItemLabel() is still
|
||||||
// valid to call in this case and should do nothing else
|
// valid to call in this case and should do nothing else
|
||||||
|
if ( !m_parentMenu )
|
||||||
|
return;
|
||||||
|
|
||||||
const UINT id = GetMSWId();
|
const UINT id = GetMSWId();
|
||||||
HMENU hMenu = GetHMenuOf(m_parentMenu);
|
HMENU hMenu = GetHMenuOf(m_parentMenu);
|
||||||
if ( !hMenu || ::GetMenuState(hMenu, id, MF_BYCOMMAND) == (UINT)-1 )
|
if ( !hMenu || ::GetMenuState(hMenu, id, MF_BYCOMMAND) == (UINT)-1 )
|
||||||
|
Reference in New Issue
Block a user