InsertMenuItem can be used by submenus having bitmaps also
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -420,11 +420,21 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
// now run-time one: MIIM_BITMAP only works under WinME/2000+
|
// now run-time one: MIIM_BITMAP only works under WinME/2000+
|
||||||
if ( wxGetWinVersion() >= wxWinVersion_98 )
|
if ( wxGetWinVersion() >= wxWinVersion_98 )
|
||||||
{
|
{
|
||||||
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_DATA | MIIM_BITMAP;
|
mii.fMask = MIIM_STRING | MIIM_DATA | MIIM_BITMAP;
|
||||||
mii.wID = id;
|
|
||||||
mii.cch = itemText.length();
|
mii.cch = itemText.length();
|
||||||
mii.dwTypeData = wx_const_cast(wxChar *, itemText.c_str());
|
mii.dwTypeData = wx_const_cast(wxChar *, itemText.c_str());
|
||||||
|
|
||||||
|
if (flags & MF_POPUP)
|
||||||
|
{
|
||||||
|
mii.fMask |= MIIM_SUBMENU;
|
||||||
|
mii.hSubMenu = (HMENU)pItem->GetSubMenu()->GetHMenu();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mii.fMask |= MIIM_ID;
|
||||||
|
mii.wID = id;
|
||||||
|
}
|
||||||
|
|
||||||
// we can't pass HBITMAP directly as hbmpItem for 2 reasons:
|
// we can't pass HBITMAP directly as hbmpItem for 2 reasons:
|
||||||
// 1. we can't draw it with transparency then (this is not
|
// 1. we can't draw it with transparency then (this is not
|
||||||
// very important now but would be with themed menu bg)
|
// very important now but would be with themed menu bg)
|
||||||
|
Reference in New Issue
Block a user