]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/menucmn.cpp
Update header control when wxPropertyGridManager is resized.
[wxWidgets.git] / src / common / menucmn.cpp
index 32f525d6738544b0d3d6ea1f71e37cb3e33cd8e9..f34a5bf0f6b43ce247da9a2c2a136f7fcfd9e0f8 100644 (file)
@@ -597,17 +597,10 @@ wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const
 // window will be used.
 void wxMenuBase::UpdateUI(wxEvtHandler* source)
 {
-    if (GetInvokingWindow())
-    {
-        // Don't update menus if the parent
-        // frame is about to get deleted
-        wxWindow *tlw = wxGetTopLevelParent( GetInvokingWindow() );
-        if (tlw && wxPendingDelete.Member(tlw))
-            return;
-    }
+    wxWindow * const win = GetWindow();
 
-    if ( !source && GetInvokingWindow() )
-        source = GetInvokingWindow()->GetEventHandler();
+    if ( !source && win )
+        source = win->GetEventHandler();
     if ( !source )
         source = GetEventHandler();
     if ( !source )
@@ -621,7 +614,7 @@ void wxMenuBase::UpdateUI(wxEvtHandler* source)
         {
             wxWindowID itemid = item->GetId();
             wxUpdateUIEvent event(itemid);
-            event.SetEventObject( source );
+            event.SetEventObject( this );
 
             if ( source->ProcessEvent(event) )
             {
@@ -1045,18 +1038,13 @@ wxString wxMenuBarBase::GetHelpString(int itemid) const
 
 void wxMenuBarBase::UpdateMenus()
 {
-    wxEvtHandler* source;
     wxMenu* menu;
     int nCount = GetMenuCount();
     for (int n = 0; n < nCount; n++)
     {
         menu = GetMenu( n );
         if (menu != NULL)
-        {
-            source = menu->GetEventHandler();
-            if (source != NULL)
-                menu->UpdateUI( source );
-        }
+            menu->UpdateUI( NULL );
     }
 }