X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3f5caa223f582b3a4bf375e200de7fb216b568f..88932ec82d048d006cdc81bd309f5e59aee799ac:/src/univ/menu.cpp diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 4714ba73f3..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(); } @@ -2497,10 +2493,6 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) Update(); #endif // 0 - menu->SetInvokingWindow(this); - - // wxLogDebug( "Name of invoking window %s", menu->GetInvokingWindow()->GetName().c_str() ); - menu->Popup(ClientToScreen(wxPoint(x, y)), wxSize(0,0)); // this is not very useful if the menu was popped up because of the mouse @@ -2517,14 +2509,11 @@ 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 */); - menu->SetInvokingWindow(NULL); - #ifdef __WXMSW__ SetCursor(cursorOld); #endif // __WXMSW__