Changed MM_DELETEITEM to MM_REMOVEITEM so reinserting is possible.
This possibly created a memory leak? git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -836,7 +836,7 @@ wxMenu* wxMenuBar::Replace(
|
|||||||
m_titles[nPos] = Title;
|
m_titles[nPos] = Title;
|
||||||
if (IsAttached())
|
if (IsAttached())
|
||||||
{
|
{
|
||||||
::WinSendMsg((HWND)m_hMenu, MM_DELETEITEM, MPFROM2SHORT(nId, TRUE), (MPARAM)0);
|
::WinSendMsg((HWND)m_hMenu, MM_REMOVEITEM, MPFROM2SHORT(nId, TRUE), (MPARAM)0);
|
||||||
::WinSendMsg((HWND)m_hMenu, MM_INSERTITEM, (MPARAM)&pMenu->m_vMenuData, (MPARAM)Title.c_str());
|
::WinSendMsg((HWND)m_hMenu, MM_INSERTITEM, (MPARAM)&pMenu->m_vMenuData, (MPARAM)Title.c_str());
|
||||||
|
|
||||||
#if wxUSE_ACCEL
|
#if wxUSE_ACCEL
|
||||||
@@ -939,7 +939,7 @@ wxMenu* wxMenuBar::Remove(
|
|||||||
}
|
}
|
||||||
if (IsAttached())
|
if (IsAttached())
|
||||||
{
|
{
|
||||||
::WinSendMsg((HWND)GetHmenu(), MM_DELETEITEM, MPFROM2SHORT(nId, TRUE), (MPARAM)0);
|
::WinSendMsg((HWND)GetHmenu(), MM_REMOVEITEM, MPFROM2SHORT(nId, TRUE), (MPARAM)0);
|
||||||
pMenu->Detach();
|
pMenu->Detach();
|
||||||
|
|
||||||
#if wxUSE_ACCEL
|
#if wxUSE_ACCEL
|
||||||
|
Reference in New Issue
Block a user