// ----------------------------------------------------------------------------
// the (popup) menu title has this special id
-static const int idMenuTitle = -2;
+static const int idMenuTitle = -3;
// ----------------------------------------------------------------------------
// private functions
m_startRadioGroup = -1;
}
-bool wxMenu::DoAppend(wxMenuItem *item)
+wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
{
- wxCHECK_MSG( item, FALSE, _T("NULL item in wxMenu::DoAppend") );
+ wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") );
bool check = FALSE;
if ( !wxMenuBase::DoAppend(item) || !DoInsertOrAppend(item) )
{
- return FALSE;
+ return NULL;
}
if ( check )
item->Check(TRUE);
}
- return TRUE;
+ return item;
}
-bool wxMenu::DoInsert(size_t pos, wxMenuItem *item)
+wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item)
{
- return wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos);
+ if (wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos))
+ return item;
+ else
+ return NULL;
}
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
wxASSERT(menu);
wxASSERT(menu->GetHMenu());
wxASSERT(m_hMenu);
+
+#if defined(__WXWINCE__)
+ int totalMSWItems = GetMenuCount();
+#else
int totalMSWItems = GetMenuItemCount((HMENU)m_hMenu);
+#endif
+
int i; // For old C++ compatibility
for(i=wxpos; i<totalMSWItems; i++)
{