]> git.saurik.com Git - wxWidgets.git/commitdiff
Removed overloaded DoMenuUpdates function since it duplicated
authorJulian Smart <julian@anthemion.co.uk>
Wed, 9 Jul 2003 14:20:30 +0000 (14:20 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 9 Jul 2003 14:20:30 +0000 (14:20 +0000)
wxMenu::UpdateUI()
Removed routing of menu commands to focus window under Windows
Added routing of menu commands (but not UI updates, for
efficiency reasons) to wxMenuBar before sending to frame

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/todo30.txt
include/wx/frame.h
src/common/framecmn.cpp
src/common/menucmn.cpp

index 031831d54928c6e1c355aad865f71d73a6841fad..008b93a19ecd48dbb1c75738a3f0db45d45d3937 100644 (file)
@@ -157,18 +157,8 @@ In addition to wxCOMPATIBILITY code:
 - contrib/src/canvas?
 - contrib/src/mmedia
 - contrib/src/applet?
-- utils/Install
-- wxDate, wxTime
 - Old wxODBC code
-- wxExpr (rewriting some OGL code or bundling wxExpr with OGL)
-- Old resource system
-- samples/resource
 - Dialog Editor
-- generic/src/htmlhelp.cpp
-- all code that uses layout constraints,
-  so constraints can be compiled out of the
-  core library
-
 
 wxMiscellaneous
 ===============
index 646cce0a237bf82a8593d095fd4b3e875dad2200..358246aea665140a3f9256a9c04663cd974350d6 100644 (file)
@@ -147,7 +147,6 @@ public:
 #if wxUSE_MENUS
     // send wxUpdateUIEvents for all menu items (called from OnIdle())
     void DoMenuUpdates();
-    void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin);
 #endif // wxUSE_MENUS
 
     // do the UI update processing for this window
index 42669bd92eb7beefff506a2888f02d90dcbaee98..2ab0ab0fa36abc5b552937aa64255a9cfeb1b4a8 100644 (file)
@@ -413,47 +413,12 @@ void wxFrameBase::DoMenuUpdates()
 {
     wxMenuBar* bar = GetMenuBar();
 
-#ifdef __WXMSW__
-    wxWindow* focusWin = wxFindFocusDescendant((wxWindow*) this);
-#else
-    wxWindow* focusWin = (wxWindow*) NULL;
-#endif
     if ( bar != NULL )
     {
+        wxEvtHandler* source = GetEventHandler();
         int nCount = bar->GetMenuCount();
         for (int n = 0; n < nCount; n++)
-            DoMenuUpdates(bar->GetMenu(n), focusWin);
-    }
-}
-
-// update a menu and all submenus recursively
-void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* focusWin)
-{
-    wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler();
-    wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst();
-    while (node)
-    {
-        wxMenuItem* item = node->GetData();
-        if ( !item->IsSeparator() )
-        {
-            wxWindowID id = item->GetId();
-            wxUpdateUIEvent event(id);
-            event.SetEventObject( this );
-
-            if (evtHandler->ProcessEvent(event))
-            {
-                if (event.GetSetText())
-                    menu->SetLabel(id, event.GetText());
-                if (event.GetSetChecked())
-                    menu->Check(id, event.GetChecked());
-                if (event.GetSetEnabled())
-                    menu->Enable(id, event.GetEnabled());
-            }
-
-            if (item->GetSubMenu())
-                DoMenuUpdates(item->GetSubMenu(), focusWin);
-        }
-        node = node->GetNext();
+            bar->GetMenu(n)->UpdateUI(source);
     }
 }
 
index 865d668be2f4e50619e4f53d47c6a594227ea4e4..5422c06677e80909c61e6338fa9a50355e712a9f 100644 (file)
@@ -553,7 +553,7 @@ void wxMenuBase::UpdateUI(wxEvtHandler* source)
 
             if ( source->ProcessEvent(event) )
             {
-                // if anything changed, update the chanegd attribute
+                // if anything changed, update the changed attribute
                 if (event.GetSetText())
                     SetLabel(id, event.GetText());
                 if (event.GetSetChecked())
@@ -566,7 +566,7 @@ void wxMenuBase::UpdateUI(wxEvtHandler* source)
             if ( item->GetSubMenu() )
                 item->GetSubMenu()->UpdateUI(source);
         }
-        //else: item is a separator (which don't process update UI events)
+        //else: item is a separator (which doesn't process update UI events)
 
         node = node->GetNext();
     }