From 417eff2bf8b9d604d1f6d1ba174cba13ad45aeec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Aug 2019 20:11:23 +0200 Subject: [PATCH] Add missing wxUSE_MENUS checks to generic MDI classes Make mdig.cpp compile with wxUSE_MENUS==0, as it already had many wxUSE_MENUS checks and only missed a few more of them. See #9626. --- include/wx/generic/mdig.h | 2 ++ src/generic/mdig.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/wx/generic/mdig.h b/include/wx/generic/mdig.h index d3469069c3..7bc835d281 100644 --- a/include/wx/generic/mdig.h +++ b/include/wx/generic/mdig.h @@ -199,7 +199,9 @@ protected: void Init(); private: +#if wxUSE_MENUS void OnMenuHighlight(wxMenuEvent& event); +#endif // wxUSE_MENUS void OnClose(wxCloseEvent& event); wxDECLARE_DYNAMIC_CLASS(wxGenericMDIChildFrame); diff --git a/src/generic/mdig.cpp b/src/generic/mdig.cpp index e2d01d4585..b7899dc1be 100644 --- a/src/generic/mdig.cpp +++ b/src/generic/mdig.cpp @@ -382,7 +382,9 @@ bool wxGenericMDIParentFrame::ProcessEvent(wxEvent& event) wxIMPLEMENT_DYNAMIC_CLASS(wxGenericMDIChildFrame, wxFrame); wxBEGIN_EVENT_TABLE(wxGenericMDIChildFrame, wxFrame) +#if wxUSE_MENUS EVT_MENU_HIGHLIGHT_ALL(wxGenericMDIChildFrame::OnMenuHighlight) +#endif // wxUSE_MENUS EVT_CLOSE(wxGenericMDIChildFrame::OnClose) wxEND_EVENT_TABLE() @@ -493,6 +495,7 @@ void wxGenericMDIChildFrame::Activate() parent->WXActivateChild(this); } +#if wxUSE_MENUS void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event) { wxGenericMDIParentFrame * const parent = GetGenericMDIParent(); @@ -503,6 +506,7 @@ void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event) parent->OnMenuHighlight(event); } } +#endif // wxUSE_MENUS void wxGenericMDIChildFrame::OnClose(wxCloseEvent& WXUNUSED(event)) {