lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6540] Remove unneeded statusbar workarounds (VZ)


From: Greg Chicares
Subject: [lmi-commits] [6540] Remove unneeded statusbar workarounds (VZ)
Date: Wed, 30 Mar 2016 21:35:23 +0000

Revision: 6540
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6540
Author:   chicares
Date:     2016-03-30 21:35:23 +0000 (Wed, 30 Mar 2016)
Log Message:
-----------
Remove unneeded statusbar workarounds (VZ)

Modified Paths:
--------------
    lmi/trunk/docmdichildframe_ex.cpp
    lmi/trunk/docmdichildframe_ex.hpp

Modified: lmi/trunk/docmdichildframe_ex.cpp
===================================================================
--- lmi/trunk/docmdichildframe_ex.cpp   2016-03-30 21:32:12 UTC (rev 6539)
+++ lmi/trunk/docmdichildframe_ex.cpp   2016-03-30 21:35:23 UTC (rev 6540)
@@ -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<wxFrame*>(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

Modified: lmi/trunk/docmdichildframe_ex.hpp
===================================================================
--- lmi/trunk/docmdichildframe_ex.hpp   2016-03-30 21:32:12 UTC (rev 6539)
+++ lmi/trunk/docmdichildframe_ex.hpp   2016-03-30 21:35:23 UTC (rev 6540)
@@ -21,46 +21,8 @@
 
 // $Id$
 
-// Enhance class wxDocMDIChildFrame to support MDI without requiring
-// the parent MDI frame window to display a 'Window' menu when it has
-// no MDI child, as recommended in msw platform documentation. This
-// implementation is rather specific to that platform.
+// This will soon be removed because it no longer serves any purpose.
 
-// The wx implementation of OnMenuHighlight() assumes that MDI child
-// frames have statusbars, but that practice is uncommon, at least for
-// msw, where typically only the MDI parent frame has a statusbar.
-// Instead of copying implementation details of OnMenuHighlight()
-// here, GetStatusBar() is overridden to change its behavior when it
-// is called in the menu-highlighting context. The new behavior shunts
-// menu highlighting to the parent frame's statusbar iff the child
-// frame has none. 'status_bar_sought_from_menu_highlight_handler_' is
-// a mode flag used to accomplish this. A more straightforward patch
-// to the library could be devised.
-
-// WX !! Even without these changes, handling enablement of child-frame
-// menuitems takes a bit of work. For example, change 'samples/mdi' by
-// adding EVT_MENU_OPEN handlers for both parent and child that call
-//   event.GetMenu()
-//   event.GetEventObject()
-// and report their values. All menus on the menubar report the parent
-// as the event object, but the 'window menu' and child menus return
-// null from GetMenu(). The child's system menu, however, reports the
-// child as its event object. Now add EVT_UPDATE_UI handlers for the
-// MDI_ABOUT item, for both parent and child: they are triggered only
-// by activating the respective system menu. Alternatively, add
-// EVT_UPDATE_UI handlers for MDI_CHILD_QUIT: only the child's handler
-// is triggered, and only when its system menu is activated. None of
-// these EVT_UPDATE_UI handlers can be triggered by manipulating the
-// menubars that own the menuitems corresponding to these events. At
-// least in these cases, the wx documentation for wxUpdateUIEvent:
-//   "On Windows and GTK+, events for menubar items are only sent when
-//   the menu is about to be shown, and not in idle time"
-// could be clarified.
-//
-// It seems satisfactory, however, to catch EVT_MENU_OPEN, in the
-// parent class only, with a handler that manages either parent or
-// child menuitems depending on whether GetActiveChild() returns null.
-
 #ifndef docmdichildframe_ex_hpp
 #define docmdichildframe_ex_hpp
 
@@ -88,14 +50,6 @@
         );
 
   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()
 };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]