X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e0dd12db9955e1e173064bde29943f171c53698f..97e324eff05f010ce59985c670bbe501edfa75c2:/src/common/menucmn.cpp diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 3b2c9d37aa..bf618f7939 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -98,6 +98,8 @@ static inline bool CompareAccelString(const wxString& str, const wxChar *accel) // specified wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) { + // wxPrintf( wxT("label %s\n"), label.c_str() ); + // check for accelerators: they are given after '\t' int posTab = label.Find(wxT('\t')); if ( posTab != wxNOT_FOUND ) { @@ -276,6 +278,8 @@ void wxMenuItemBase::SetAccel(wxAcceleratorEntry *accel) #endif // wxUSE_ACCEL +bool wxMenuBase::ms_locked = true; + // ---------------------------------------------------------------------------- // wxMenu ctor and dtor // ---------------------------------------------------------------------------- @@ -537,6 +541,15 @@ 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; + } + if ( !source && GetInvokingWindow() ) source = GetInvokingWindow()->GetEventHandler(); if ( !source )