return GetHbitmapOf(pItem->GetBitmap(checked));
}
+ //else: bitmap is not set
+
+ return NULL;
}
#endif // wxUSE_IMAGE
WinStruct<MENUITEMINFO> mii;
mii.fMask = MIIM_STRING | MIIM_DATA;
- if ( pItem->GetBitmap().IsOk() )
- {
- mii.fMask |= MIIM_BITMAP;
- mii.hbmpItem = GetHBitmapForMenu(pItem);
- }
-
+ // don't set hbmpItem for the checkable items as it would
+ // be used for both checked and unchecked state
if ( pItem->IsCheckable() )
{
mii.fMask |= MIIM_CHECKMARKS;
mii.hbmpChecked = GetHBitmapForMenu(pItem, true);
mii.hbmpUnchecked = GetHBitmapForMenu(pItem, false);
}
+ else if ( pItem->GetBitmap().IsOk() )
+ {
+ mii.fMask |= MIIM_BITMAP;
+ mii.hbmpItem = GetHBitmapForMenu(pItem);
+ }
mii.cch = itemText.length();
mii.dwTypeData = const_cast<wxChar *>(itemText.wx_str());