]> git.saurik.com Git - wxWidgets.git/commitdiff
Invocation of default button by <ENTER> was impossible in wxLB_MULTIPLE
authorRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 18:31:58 +0000 (18:31 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 18:31:58 +0000 (18:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/listbox.cpp

index 634f2fd26e13b09634634abf85d0e4f2aa397707..5c1bbc56b10cb10149b8b4847aa4e5fb1bf599e7 100644 (file)
@@ -178,10 +178,19 @@ gtk_listbox_key_press_callback( GtkWidget *WXUNUSED(widget),
         (gdk_event->keyval == GDK_ISO_Enter) ||
         (gdk_event->keyval == GDK_KP_Enter))
     {
-        int index = listbox->GetSelection();
-        if (index != wxNOT_FOUND)
+        int index = -1;
+        if (!listbox->HasMultipleSelection())
+            index = listbox->GetSelection();
+        else
         {
+            wxArrayInt sels;
+            if (listbox->GetSelections( sels ) < 1)
+                return FALSE;
+            index = sels[0];
+        }
         
+        if (index != wxNOT_FOUND)
+        {
             wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() );
             event.SetEventObject( listbox );