X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c59aa14a6c1f23ddcd34822443483332a5ee81c3..fb8d7eb7a880f1f2e32d8830f9c5e12b2536e05f:/src/univ/menu.cpp?ds=sidebyside diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 571761f561..957fb39972 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -281,10 +281,6 @@ private: // wxWin macros // ---------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow) -IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) - BEGIN_EVENT_TABLE(wxPopupMenuWindow, wxPopupTransientWindow) EVT_KEY_DOWN(wxPopupMenuWindow::OnKeyDown) @@ -606,7 +602,7 @@ void wxPopupMenuWindow::DoDraw(wxControlRenderer *renderer) bmp = item->GetDisabledBitmap(); } - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { // strangely enough, for unchecked item we use the // "checked" bitmap because this is the default one - this @@ -1096,11 +1092,7 @@ const wxMenuGeometryInfo& wxMenu::GetGeometryInfo() const void wxMenu::InvalidateGeometryInfo() { - if ( m_geometry ) - { - delete m_geometry; - m_geometry = NULL; - } + wxDELETE(m_geometry); } // ---------------------------------------------------------------------------- @@ -1215,6 +1207,10 @@ void wxMenu::Attach(wxMenuBarBase *menubar) void wxMenu::Detach() { + // After the menu is detached from the menu bar, it shouldn't send its + // events to it. + SetNextHandler(NULL); + wxMenuBase::Detach(); } @@ -2513,8 +2509,7 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) ms_evtLoopPopup = new wxEventLoop; ms_evtLoopPopup->Run(); - delete ms_evtLoopPopup; - ms_evtLoopPopup = NULL; + wxDELETE(ms_evtLoopPopup); // remove the handler PopEventHandler(true /* delete it */);