// 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)
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
void wxMenu::InvalidateGeometryInfo()
{
- if ( m_geometry )
- {
- delete m_geometry;
- m_geometry = NULL;
- }
+ wxDELETE(m_geometry);
}
// ----------------------------------------------------------------------------
void wxMenu::Detach()
{
+ // After the menu is detached from the menu bar, it shouldn't send its
+ // events to it.
+ SetNextHandler(NULL);
+
wxMenuBase::Detach();
}
ms_evtLoopPopup = new wxEventLoop;
ms_evtLoopPopup->Run();
- delete ms_evtLoopPopup;
- ms_evtLoopPopup = NULL;
+ wxDELETE(ms_evtLoopPopup);
// remove the handler
PopEventHandler(true /* delete it */);