]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/menu.cpp
Simplify wxGridCellAutoWrapStringRenderer::GetBestSize().
[wxWidgets.git] / src / univ / menu.cpp
index 571761f561d1d3a4f4dc51c73e8ae7cfbe8d3bc2..ed0c4a05a91b1a0c5072f4596a9189005222fa84 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     25.08.00
-// RCS-ID:      $Id$
 // Copyright:   (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -281,10 +280,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 +601,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 +1091,7 @@ const wxMenuGeometryInfo& wxMenu::GetGeometryInfo() const
 
 void wxMenu::InvalidateGeometryInfo()
 {
-    if ( m_geometry )
-    {
-        delete m_geometry;
-        m_geometry = NULL;
-    }
+    wxDELETE(m_geometry);
 }
 
 // ----------------------------------------------------------------------------
@@ -1215,6 +1206,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 +2508,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 */);