Fix finding menu items in wxMenuItem::DoSetBitmap.
FindChildItem gets passed the id of a menu item as returned by GetMSWId, however GetMSWId should be used in combination with Win32 API functions. Instead use GetId: this fixes finding menu items that have a negative id (as a result of using wxID_ANY as id) or have a sub menu. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -761,7 +761,7 @@ void wxMenuItem::DoSetBitmap(const wxBitmap& bmp, bool bChecked)
|
||||
if ( m_parentMenu )
|
||||
{
|
||||
size_t pos;
|
||||
wxMenuItem *item = m_parentMenu->FindChildItem(GetMSWId(), &pos);
|
||||
wxMenuItem *item = m_parentMenu->FindChildItem(GetId(), &pos);
|
||||
if ( item )
|
||||
{
|
||||
wxCHECK_RET( item == this, wxS("Non unique menu item ID?") );
|
||||
|
Reference in New Issue
Block a user