X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/563f85a9566128124df05eed60634a268dadf4c8..46405e36bf9962b251e77e5048e96bf6a54edb15:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index b7348f020e..077b030d33 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -295,7 +295,7 @@ void wxFrame::DoGetClientSize(int *x, int *y) const wxStatusBar *statbar = GetStatusBar(); if ( statbar && statbar->IsShown() ) { - *y -= statbar->GetClientSize().y; + *y -= statbar->GetSize().y; } } #endif // wxUSE_STATUSBAR @@ -896,11 +896,15 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU WXUNUSED(hMenu)) { + // sign extend to int from unsigned short we get from Windows + int item = (signed short)nItem; + // WM_MENUSELECT is generated for both normal items and menus, including // the top level menus of the menu bar, which can't be represented using - // any valid identifier in wxMenuEvent so use -1 for them - // the menu highlight events for n - const int item = flags & (MF_POPUP | MF_SEPARATOR) ? -1 : nItem; + // any valid identifier in wxMenuEvent so use an otherwise unused value for + // them + if ( flags & (MF_POPUP | MF_SEPARATOR) ) + item = wxID_NONE; wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item); event.SetEventObject(this); @@ -911,7 +915,7 @@ wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU WXUNUSED(hMenu)) // by default, i.e. if the event wasn't handled above, clear the status bar // text when an item which can't have any associated help string in wx API // is selected - if ( item == -1 ) + if ( item == wxID_NONE ) DoGiveHelp(wxEmptyString, true); return false;