>From e362c659eb459cfb8be63a7c7860c56074f2b761 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 28 Nov 2014 02:48:26 +0100 Subject: [PATCH 4/4] Remove the attempts to use MDI parent status bar for menu help display. This code actually had no effect because the MDI child frame never received wxEVT_MENU_HIGHLIGHT anyhow and the help was (correctly) displayed in the parent frame status bar just because this is where all the events went. --- docmdichildframe_ex.cpp | 46 ---------------------------------------------- docmdichildframe_ex.hpp | 8 -------- 2 files changed, 0 insertions(+), 54 deletions(-) diff --git a/docmdichildframe_ex.cpp b/docmdichildframe_ex.cpp index 4655299..7b2ba9c 100644 --- a/docmdichildframe_ex.cpp +++ b/docmdichildframe_ex.cpp @@ -30,7 +30,6 @@ IMPLEMENT_CLASS(DocMDIChildFrameEx, wxDocMDIChildFrame) BEGIN_EVENT_TABLE(DocMDIChildFrameEx, wxDocMDIChildFrame) - EVT_MENU_HIGHLIGHT_ALL(DocMDIChildFrameEx::UponMenuHighlight) END_EVENT_TABLE() DocMDIChildFrameEx::DocMDIChildFrameEx @@ -45,54 +44,9 @@ ,wxString const& name ) :wxDocMDIChildFrame(doc, view, parent, id, title, pos, size, style, name) - ,status_bar_sought_from_menu_highlight_handler_(false) { } -wxStatusBar* DocMDIChildFrameEx::GetStatusBar() const -{ - if(!status_bar_sought_from_menu_highlight_handler_) - { - return wxDocMDIChildFrame::GetStatusBar(); - } - - wxStatusBar* status_bar = wxDocMDIChildFrame::GetStatusBar(); - if(status_bar) - { - return status_bar; - } - - wxFrame* parent_frame = dynamic_cast(GetParent()); - if(parent_frame) - { - return parent_frame->GetStatusBar(); - } - - return 0; -} - -/// This augments wxDocMDIChildFrame::OnMenuHighlight(), but isn't a -/// complete replacement. It calls that base-class function explicitly -/// because Skip() wouldn't work here. - -void DocMDIChildFrameEx::UponMenuHighlight(wxMenuEvent& event) -{ - try - { - status_bar_sought_from_menu_highlight_handler_ = true; - if(GetStatusBar()) - { - wxDocMDIChildFrame::OnMenuHighlight(event); - } - status_bar_sought_from_menu_highlight_handler_ = false; - } - catch(...) - { - status_bar_sought_from_menu_highlight_handler_ = false; - throw; - } -} - #if !wxCHECK_VERSION(2,5,4) // The MDI "Window" menu did not display correctly for wx // versions prior to 2.5.4 . This error directive may be diff --git a/docmdichildframe_ex.hpp b/docmdichildframe_ex.hpp index 4928a68..75bb189 100644 --- a/docmdichildframe_ex.hpp +++ b/docmdichildframe_ex.hpp @@ -88,14 +88,6 @@ class DocMDIChildFrameEx ); private: - // WX !! Shouldn't OnMenuHighlight() be virtual? - void UponMenuHighlight(wxMenuEvent&); - - // wxDocMDIChildFrame overrides. - virtual wxStatusBar* GetStatusBar() const; - - bool status_bar_sought_from_menu_highlight_handler_; - DECLARE_CLASS(DocMDIChildFrameEx) DECLARE_EVENT_TABLE() }; -- 1.7.9