corrected error in last fix for insert items
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -145,10 +145,14 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// MacOS counts menu items from 1 and inserts after, therefore having the
|
||||||
|
// same effect as wx 0 based and inserting before, we must correct pos
|
||||||
|
// after however for updates to be correct
|
||||||
UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos);
|
UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos);
|
||||||
|
pos += 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos+1 , pItem->GetId() ) ;
|
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , pItem->GetId() ) ;
|
||||||
pItem->UpdateItemText() ;
|
pItem->UpdateItemText() ;
|
||||||
pItem->UpdateItemBitmap() ;
|
pItem->UpdateItemBitmap() ;
|
||||||
pItem->UpdateItemStatus() ;
|
pItem->UpdateItemStatus() ;
|
||||||
|
@@ -145,10 +145,14 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// MacOS counts menu items from 1 and inserts after, therefore having the
|
||||||
|
// same effect as wx 0 based and inserting before, we must correct pos
|
||||||
|
// after however for updates to be correct
|
||||||
UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos);
|
UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos);
|
||||||
|
pos += 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos+1 , pItem->GetId() ) ;
|
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , pItem->GetId() ) ;
|
||||||
pItem->UpdateItemText() ;
|
pItem->UpdateItemText() ;
|
||||||
pItem->UpdateItemBitmap() ;
|
pItem->UpdateItemBitmap() ;
|
||||||
pItem->UpdateItemStatus() ;
|
pItem->UpdateItemStatus() ;
|
||||||
|
Reference in New Issue
Block a user