X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..b81abd0d1d0fcde8db54f8c5e736b2b9daaf2ea0:/src/msw/menu.cpp diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index bf7b961b17..48b0b30706 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -434,7 +434,13 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id) wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED); event.SetEventObject( this ); event.SetId( id ); - event.SetInt( id ); + + // VZ: previosuly, the command int was set to id too which was quite + // useless anyhow (as it could be retrieved using GetId()) and + // uncompatible with wxGTK, so now we use the command int instead + // to pass the checked status + event.SetInt(::GetMenuState(GetHmenu(), id, MF_BYCOMMAND) & MF_CHECKED); + ProcessCommand(event); } @@ -552,11 +558,9 @@ void wxMenuBar::Refresh() WXHMENU wxMenuBar::Create() { - if (m_hMenu != 0 ) + if ( m_hMenu != 0 ) return m_hMenu; - wxCHECK_MSG( !m_hMenu, TRUE, wxT("menubar already created") ); - m_hMenu = (WXHMENU)::CreateMenu(); if ( !m_hMenu )