]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/menu.cpp
Committing in .
[wxWidgets.git] / src / gtk / menu.cpp
index 1149f81f86537619d1de53bbdc80dfa7ed89bd02..b3b73c34f57ad2e8a6f45f329218b428554b77e4 100644 (file)
@@ -567,7 +567,8 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
 
     wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, id );
     event.SetEventObject( menu );
-    event.SetInt(id );
+    if (item->IsCheckable())
+        event.SetInt( item->IsChecked() );
 
 #if wxUSE_MENU_CALLBACK
     if (menu->GetCallback())
@@ -948,8 +949,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
         // due to an apparent bug in GTK+, we have to use a static buffer here -
         // otherwise GTK+ 1.2.2 manages to override the memory we pass to it
         // somehow! (VZ)
-        static char s_accel[32]; // must be big enough for <control><alt><shift>F12
-        strncpy(s_accel, GetHotKey(*mitem).mb_str(), WXSIZEOF(s_accel));
+        static char s_accel[50]; // must be big enougg
+        wxString tmp( GetHotKey(*mitem) );
+        strncpy(s_accel, tmp.mb_str(), WXSIZEOF(s_accel));
         entry.accelerator = s_accel;
 #else // !wxUSE_ACCEL
         entry.accelerator = (char*) NULL;
@@ -1090,6 +1092,20 @@ static wxString GetHotKey( const wxMenuItem& item )
             case WXK_F12:
                 hotkey << wxT('F') << code - WXK_F1 + 1;
                 break;
+                
+                // GTK seems to use XStringToKeySym here
+            case WXK_NUMPAD_INSERT:
+                hotkey << wxT("KP_Insert" );
+                break;
+            case WXK_NUMPAD_DELETE:
+                hotkey << wxT("KP_Delete" );
+                break;
+            case WXK_INSERT:
+                hotkey << wxT("Insert" );
+                break;
+            case WXK_DELETE:
+                hotkey << wxT("Delete" );
+                break;
 
                 // if there are any other keys wxGetAccelFromString() may return,
                 // we should process them here