// ----------------------------------------------------------------------------
// the (popup) menu title has this special id
-static const int idMenuTitle = -2;
+static const int idMenuTitle = -3;
// ----------------------------------------------------------------------------
// private functions
if ( IsAttached() )
{
- m_menuBar->RebuildAccelTable();
+ GetMenuBar()->RebuildAccelTable();
}
}
//else: it is a separator, they can't have accels, nothing to do
#endif // __WIN32__
// if we're already attached to the menubar, we must update it
- if ( IsAttached() && m_menuBar->IsAttached() )
+ if ( IsAttached() && GetMenuBar()->IsAttached() )
{
- m_menuBar->Refresh();
+ GetMenuBar()->Refresh();
}
return TRUE;
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)
wxLogLastError(wxT("RemoveMenu"));
}
- if ( IsAttached() && m_menuBar->IsAttached() )
+ if ( IsAttached() && GetMenuBar()->IsAttached() )
{
// otherwise, the chane won't be visible
- m_menuBar->Refresh();
+ GetMenuBar()->Refresh();
}
// and from internal data structures
{
if ( m_invokingWindow != NULL )
return m_invokingWindow;
- else if ( m_menuBar != NULL)
- return m_menuBar->GetFrame();
+ else if ( GetMenuBar() != NULL)
+ return GetMenuBar()->GetFrame();
return NULL;
}
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++)
{