X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36f1f456497faa46bfdaf3af9936bb4f7498a6b4..8f2c3ee9a0fb0457f81f4d70ad0077bf092b8a6a:/src/msw/menu.cpp?ds=sidebyside diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 3b1499ce24..37d22056e1 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -106,7 +106,8 @@ UINT GetMenuState(HMENU hMenu, UINT id, UINT flags) 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; } @@ -697,13 +698,13 @@ wxMenuBar::wxMenuBar( long WXUNUSED(style) ) 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]); @@ -716,9 +717,13 @@ wxMenuBar::~wxMenuBar() { // 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