X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4b10e41c7c275927fcc9999f81b6f65eadc7d31..f33396842a7bdecef5c1de6f80b145a096bbeabc:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 5c9b873da5..a96d6d99b6 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -761,7 +761,7 @@ void wxFrame::MSWOnMenuHighlight(WXWORD nItem, WXWORD nFlags, WXHMENU hSysMenu) event.SetEventObject( this ); GetEventHandler()->ProcessEvent(event); } - else if (nFlags != MF_SEPARATOR) + else if ((nFlags != MF_SEPARATOR) && (nItem != 0) && (nItem != 65535)) { wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, nItem); event.SetEventObject( this ); @@ -863,7 +863,7 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event) if ( menuId != -1 ) { wxMenuBar *menuBar = GetMenuBar(); - if (menuBar) + if (menuBar && menuBar->FindItem(menuId)) { // set status text even if the string is empty - this will at // least remove the string from the item which was previously @@ -916,7 +916,16 @@ void wxFrame::ProcessCommand(int id) { bar->Check(id,!bar->Checked(id)) ; } - GetEventHandler()->ProcessEvent(commandEvent); + +/* + // Process events starting with the window with the focus, if any. + wxWindow* focusWin = wxFindFocusDescendant(this); + + wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler(); +*/ + + wxEvtHandler* evtHandler = GetEventHandler(); + evtHandler->ProcessEvent(commandEvent); } // Checks if there is a toolbar, and returns the first free client position