]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/menu.cpp
A little clarification
[wxWidgets.git] / src / gtk / menu.cpp
index a44c91e123ea73dc6d3beddc474e5bd16d734bb0..edcbeb0d65c3506f8e685724cd62ab29c9d1d354 100644 (file)
@@ -7,11 +7,14 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // 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
 
 #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"
 #include "wx/log.h"
 #include "wx/intl.h"
 #include "wx/app.h"
@@ -729,6 +732,10 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
         pm = pm->GetParent();
     }
 
         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.
     if (frame)
     {
         // If it is attached then let the frame send the event.
@@ -738,6 +745,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
         commandEvent.SetEventObject(frame);
         if (item->IsCheckable())
             commandEvent.SetInt(item->IsChecked());
         commandEvent.SetEventObject(frame);
         if (item->IsCheckable())
             commandEvent.SetInt(item->IsChecked());
+        commandEvent.SetEventObject(menu);
 
         frame->GetEventHandler()->ProcessEvent(commandEvent);
     }
 
         frame->GetEventHandler()->ProcessEvent(commandEvent);
     }
@@ -1467,9 +1475,11 @@ static wxString GetHotKey( const wxMenuItem& item )
                 hotkey << wxT("Down" );
                 break;
             case WXK_PAGEUP:
                 hotkey << wxT("Down" );
                 break;
             case WXK_PAGEUP:
+            case WXK_PRIOR:
                 hotkey << wxT("Prior" );
                 break;
             case WXK_PAGEDOWN:
                 hotkey << wxT("Prior" );
                 break;
             case WXK_PAGEDOWN:
+            case WXK_NEXT:
                 hotkey << wxT("Next" );
                 break;
             case WXK_LEFT:
                 hotkey << wxT("Next" );
                 break;
             case WXK_LEFT: