]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/listbox.cpp
made Add() public so that it could be called for addition HWNDs making part of the...
[wxWidgets.git] / src / gtk1 / listbox.cpp
index b71512c25085bee13244b1d67ac294540359257e..b522fd7a88bdc5c8586a4b37bea7683517175482 100644 (file)
@@ -233,18 +233,21 @@ gtk_listbox_button_press_callback( GtkWidget *widget,
     }
 #endif // wxUSE_CHECKLISTBOX
 
-#if 0
     if ((gdk_event->state == 0) &&
          (((listbox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0) ||
           ((listbox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)) )
     {
-        if (listbox->IsSelected(sel))
-        {
-            gtk_list_unselect_item( GTK_LIST(listbox->m_list), sel );
-            return true;
-        }
+            listbox->m_blockEvent = TRUE;
+
+            int i;
+            for (i = 0; i < (int)listbox->GetCount(); i++)
+                if (i != sel)
+                    gtk_list_unselect_item( GTK_LIST(listbox->m_list), i );
+                
+            listbox->m_blockEvent = FALSE;
+            
+            return false;
     }
-#endif
 
     /* emit wxEVT_COMMAND_LISTBOX_DOUBLECLICKED later */
     g_hasDoubleClicked = (gdk_event->type == GDK_2BUTTON_PRESS);