wxZeroMemory(info);
info.cbSize = sizeof(info);
info.fMask = MIIM_STATE;
- if ( !::GetMenuItemInfo(hMenu, id, flags & MF_BYCOMMAND ? FALSE : TRUE, & info) )
+ // MF_BYCOMMAND is zero so test MF_BYPOSITION
+ if ( !::GetMenuItemInfo(hMenu, id, flags & MF_BYPOSITION ? TRUE : FALSE , & info) )
wxLogLastError(wxT("GetMenuItemInfo"));
return info.fState;
}
Init();
}
-wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[])
+wxMenuBar::wxMenuBar(size_t count, wxMenu *menus[], const wxString titles[], long WXUNUSED(style))
{
Init();
m_titles.Alloc(count);
- for ( int i = 0; i < count; i++ )
+ for ( size_t i = 0; i < count; i++ )
{
m_menus.Append(menus[i]);
m_titles.Add(titles[i]);
{
// In Windows CE (not .NET), the menubar is always associated
// with a toolbar, which destroys the menu implicitly.
-#if defined(WINCE_WITHOUT_COMMANDBAR)
+#if defined(WINCE_WITHOUT_COMMANDBAR) && defined(__POCKETPC__)
if (GetToolBar())
- GetToolBar()->SetMenuBar(NULL);
+ {
+ wxToolMenuBar* toolMenuBar = wxDynamicCast(GetToolBar(), wxToolMenuBar);
+ if (toolMenuBar)
+ toolMenuBar->SetMenuBar(NULL);
+ }
#else
// we should free Windows resources only if Windows doesn't do it for us
// which happens if we're attached to a frame