+ if ((gdk_event->keyval == GDK_Return) ||
+ (gdk_event->keyval == GDK_ISO_Enter) ||
+ (gdk_event->keyval == GDK_KP_Enter))
+ {
+ 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 );
+
+ GtkTreeEntry* entry = listbox->GtkGetEntry( index );
+
+ // indicate that this is a selection
+ event.SetExtraLong( 1 );
+
+ event.SetInt( index );
+ event.SetString(wxConvUTF8.cMB2WX(gtk_tree_entry_get_label(entry)));
+
+ if ( listbox->HasClientObjectData() )
+ event.SetClientObject(
+ (wxClientData*) gtk_tree_entry_get_userdata(entry)
+ );
+ else if ( listbox->HasClientUntypedData() )
+ event.SetClientData( gtk_tree_entry_get_userdata(entry) );
+
+ /* bool ret = */ listbox->HandleWindowEvent( event );
+
+ g_object_unref (entry);
+
+// wxMac and wxMSW always invoke default action
+// if (!ret)
+ {
+ // DClick not handled -> invoke default action
+ wxWindow *tlw = wxGetTopLevelParent( listbox );
+ if (tlw)
+ {
+ GtkWindow *gtk_window = GTK_WINDOW( tlw->GetHandle() );
+ if (gtk_window)
+ gtk_window_activate_default( gtk_window );
+ }
+ }
+
+ // Always intercept, otherwise we'd get another dclick
+ // event from row_activated
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+}