- if (!listbox->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- if (listbox->m_blockEvent) return;
-
- wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
- event.SetEventObject( listbox );
-
- // indicate whether this is a selection or a deselection
- event.SetExtraLong( is_selection );
-
- if ((listbox->GetWindowStyleFlag() & wxLB_SINGLE) != 0)
- {
- int sel = listbox->GtkGetIndex( widget );
-
- if (listbox->m_prevSelection != sel)
- gtk_list_unselect_item( listbox->m_list, listbox->m_prevSelection );
-
- listbox->m_prevSelection = sel;
- }
-
- wxArrayInt aSelections;
- int n, count = listbox->GetSelections(aSelections);
- if ( count > 0 )
- {
- n = aSelections[0];
- if ( listbox->HasClientObjectData() )
- event.SetClientObject( listbox->GetClientObject(n) );
- else if ( listbox->HasClientUntypedData() )
- event.SetClientData( listbox->GetClientData(n) );
- event.SetString( listbox->GetString(n) );
- }
- else
- {
- n = -1;
- }
-
- event.SetInt(n);
-
-// No longer required with new code in wxLB_SINGLE
-// listbox->GetEventHandler()->AddPendingEvent( event );
- listbox->GetEventHandler()->ProcessEvent( event );