]> git.saurik.com Git - wxWidgets.git/commitdiff
Check accelerators before sending EVT_CHAR
authorRobin Dunn <robin@alldunn.com>
Tue, 8 Feb 2005 17:02:57 +0000 (17:02 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 8 Feb 2005 17:02:57 +0000 (17:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp
src/gtk1/window.cpp

index ddd4ba38f368b22b9742a0aaa386b828391dd9ec..4e92f5a4234156c22bc6d7a47700c01b2b2cf44e 100644 (file)
@@ -1219,6 +1219,26 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
     
 #endif  // #ifndef  __WXGTK20__
 
+#if wxUSE_ACCEL
+    if (!ret)
+    {
+        wxWindowGTK *ancestor = win;
+        while (ancestor)
+        {
+            int command = ancestor->GetAcceleratorTable()->GetCommand( event );
+            if (command != -1)
+            {
+                wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
+                ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
+                break;
+            }
+            if (ancestor->IsTopLevel())
+                break;
+            ancestor = ancestor->GetParent();
+        }
+    }
+#endif // wxUSE_ACCEL
+
     // Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x
     // will only be sent if it is not in an accelerator table.
     if (!ret)
@@ -1267,25 +1287,6 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
 
 
 
-#if wxUSE_ACCEL
-    if (!ret)
-    {
-        wxWindowGTK *ancestor = win;
-        while (ancestor)
-        {
-            int command = ancestor->GetAcceleratorTable()->GetCommand( event );
-            if (command != -1)
-            {
-                wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
-                ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
-                break;
-            }
-            if (ancestor->IsTopLevel())
-                break;
-            ancestor = ancestor->GetParent();
-        }
-    }
-#endif // wxUSE_ACCEL
 
 
     // win is a control: tab can be propagated up
index ddd4ba38f368b22b9742a0aaa386b828391dd9ec..4e92f5a4234156c22bc6d7a47700c01b2b2cf44e 100644 (file)
@@ -1219,6 +1219,26 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
     
 #endif  // #ifndef  __WXGTK20__
 
+#if wxUSE_ACCEL
+    if (!ret)
+    {
+        wxWindowGTK *ancestor = win;
+        while (ancestor)
+        {
+            int command = ancestor->GetAcceleratorTable()->GetCommand( event );
+            if (command != -1)
+            {
+                wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
+                ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
+                break;
+            }
+            if (ancestor->IsTopLevel())
+                break;
+            ancestor = ancestor->GetParent();
+        }
+    }
+#endif // wxUSE_ACCEL
+
     // Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x
     // will only be sent if it is not in an accelerator table.
     if (!ret)
@@ -1267,25 +1287,6 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
 
 
 
-#if wxUSE_ACCEL
-    if (!ret)
-    {
-        wxWindowGTK *ancestor = win;
-        while (ancestor)
-        {
-            int command = ancestor->GetAcceleratorTable()->GetCommand( event );
-            if (command != -1)
-            {
-                wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
-                ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
-                break;
-            }
-            if (ancestor->IsTopLevel())
-                break;
-            ancestor = ancestor->GetParent();
-        }
-    }
-#endif // wxUSE_ACCEL
 
 
     // win is a control: tab can be propagated up