// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "menu.h"
-#pragma implementation "menuitem.h"
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+ #pragma implementation "menu.h"
+ #pragma implementation "menuitem.h"
#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/app.h"
{
if (g_isIdle) wxapp_install_idle_handler();
- wxMenuEvent event( wxEVT_MENU_OPEN, -1 );
+ wxMenuEvent event( wxEVT_MENU_OPEN, -1, menu );
event.SetEventObject( menu );
wxEvtHandler* handler = menu->GetEventHandler();
pm = pm->GetParent();
}
+ // FIXME: why do we have to call wxFrame::GetEventHandler() directly here?
+ // normally wxMenu::SendEvent() should be enough, if it doesn't work
+ // in wxGTK then we have a bug in wxMenu::GetInvokingWindow() which
+ // should be fixed instead of working around it here...
if (frame)
{
// If it is attached then let the frame send the event.
commandEvent.SetEventObject(frame);
if (item->IsCheckable())
commandEvent.SetInt(item->IsChecked());
+ commandEvent.SetEventObject(menu);
frame->GetEventHandler()->ProcessEvent(commandEvent);
}