X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36f1f456497faa46bfdaf3af9936bb4f7498a6b4..8d0a7b563acf4bd7e75824ba2076a7ab4d81a650:/src/msw/menu.cpp?ds=sidebyside diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 3b1499ce24..12dfbd7133 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -697,13 +697,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 +716,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