X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fef0a330e98471b5a56b8fea33a6ed01e916583d..a826202ecf2e58f7bebb7514f3001dd703ddea03:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 300c0317ed..cbd908ce5a 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -398,7 +398,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar) if( menubar->GetMenuCount() == 1 ) { autoMenu = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(menubar->GetMenu(0)); - SetRightMenu(wxID_ANY, menubar->GetLabelTop(0), autoMenu); + SetRightMenu(wxID_ANY, menubar->GetMenuLabel(0), autoMenu); } else { @@ -407,7 +407,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar) for( size_t n = 0; n < menubar->GetMenuCount(); n++ ) { wxMenu *item = menubar->GetMenu(n); - wxString label = menubar->GetLabelTop(n); + wxString label = menubar->GetMenuLabel(n); wxMenu *new_item = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(item); autoMenu->Append(wxID_ANY, label, new_item); } @@ -563,6 +563,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) } #endif // wxUSE_TOOLBAR +#if wxUSE_MENUS if (m_fsStyle & wxFULLSCREEN_NOMENUBAR) { WXHMENU menu = m_hMenu; @@ -584,6 +585,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) ::SetMenu(GetHwnd(), (HMENU)menu); } } +#endif // wxUSE_MENUS #if wxUSE_STATUSBAR wxStatusBar *theStatusBar = GetStatusBar(); @@ -984,6 +986,8 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) return false; } +#if wxUSE_MENUS + bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) { int item; @@ -1004,7 +1008,7 @@ bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) // items opening popup menus (they don't have them anyhow) but do clear // the status line - otherwise, we would be left with the help message // for the previous item which doesn't apply any more - DoGiveHelp(wxEmptyString); + DoGiveHelp(wxEmptyString, true); return false; } @@ -1025,6 +1029,30 @@ bool wxFrame::HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup) return GetEventHandler()->ProcessEvent(event); } +bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu) +{ + wxMenu* menu = NULL; + if (GetMenuBar()) + { + int nCount = GetMenuBar()->GetMenuCount(); + for (int n = 0; n < nCount; n++) + { + if (GetMenuBar()->GetMenu(n)->GetHMenu() == hMenu) + { + menu = GetMenuBar()->GetMenu(n); + break; + } + } + } + + wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu); + event.SetEventObject(this); + + return GetEventHandler()->ProcessEvent(event); +} + +#endif // wxUSE_MENUS + // --------------------------------------------------------------------------- // the window proc for wxFrame // --------------------------------------------------------------------------- @@ -1061,11 +1089,12 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara processed = HandlePaint(); break; +#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) +#if wxUSE_MENUS case WM_INITMENUPOPUP: processed = HandleInitMenuPopup((WXHMENU) wParam); break; -#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) case WM_MENUSELECT: { WXWORD item, flags; @@ -1079,6 +1108,7 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara case WM_EXITMENULOOP: processed = HandleMenuLoop(wxEVT_MENU_CLOSE, (WXWORD)wParam); break; +#endif // wxUSE_MENUS case WM_QUERYDRAGICON: { @@ -1098,29 +1128,6 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara return rc; } -// handle WM_INITMENUPOPUP message -bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu) -{ - wxMenu* menu = NULL; - if (GetMenuBar()) - { - int nCount = GetMenuBar()->GetMenuCount(); - for (int n = 0; n < nCount; n++) - { - if (GetMenuBar()->GetMenu(n)->GetHMenu() == hMenu) - { - menu = GetMenuBar()->GetMenu(n); - break; - } - } - } - - wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu); - event.SetEventObject(this); - - return GetEventHandler()->ProcessEvent(event); -} - // ---------------------------------------------------------------------------- // wxFrame size management: we exclude the areas taken by menu/status/toolbars // from the client area, so the client area is what's really available for the