X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3dd4e4e05cc46ffc653730715e527af7b18b9caf..5f4987fed4dc52a35f0ddd649ae1cf9e75bb92d3:/src/msw/menu.cpp diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 5c0c4cc9d4..6809100b60 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -231,10 +231,10 @@ void wxMenu::Append(int Id, const wxString& label, void wxMenu::Delete(int id) { wxNode *node; - wxMenuItem *item; int pos; HMENU menu; + wxMenuItem *item = NULL; for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++) { item = (wxMenuItem *)node->Data(); if (item->GetId() == id) @@ -310,9 +310,9 @@ void wxMenu::SetTitle(const wxString& label) { if ( !label.IsEmpty() ) { - if ( !InsertMenu(hMenu, 0, MF_BYPOSITION | MF_STRING, - idMenuTitle, m_title) || - !InsertMenu(hMenu, 1, MF_BYPOSITION, -1, NULL) ) + if ( !InsertMenu(hMenu, 0u, MF_BYPOSITION | MF_STRING, + (unsigned)idMenuTitle, m_title) || + !InsertMenu(hMenu, 1u, MF_BYPOSITION, (unsigned)-1, NULL) ) { wxLogLastError("InsertMenu"); } @@ -332,9 +332,9 @@ void wxMenu::SetTitle(const wxString& label) else { // modify the title - if ( !ModifyMenu(hMenu, 0, + if ( !ModifyMenu(hMenu, 0u, MF_BYPOSITION | MF_STRING, - idMenuTitle, m_title) ) + (unsigned)idMenuTitle, m_title) ) { wxLogLastError("ModifyMenu"); } @@ -413,7 +413,7 @@ wxString wxMenu::GetLabel(int id) const bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id) { - wxCommandEvent event(wxEVENT_TYPE_MENU_COMMAND); + wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED); event.SetEventObject( this ); event.SetId( id ); event.SetInt( id ); @@ -667,7 +667,7 @@ bool wxMenuBar::Checked(int Id) const if (!item) return FALSE; - int Flag ; + int Flag = 0; if (itemMenu->m_hMenu) Flag=GetMenuState((HMENU)itemMenu->m_hMenu, Id, MF_BYCOMMAND) ; @@ -892,8 +892,11 @@ wxMenuItem *wxMenuBar::FindItemForId (int Id, wxMenu ** itemMenu) const wxMenuItem *item = NULL; int i; for (i = 0; i < m_menuCount; i++) - if ((item = m_menus[i]->FindItemForId (Id, itemMenu))) + { + item = m_menus[i]->FindItemForId (Id, itemMenu); + if (item) return item; + } return NULL; }