]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Compilation fixes for wx{X11,GTK1,Motif} after making ref data non copyable.
[wxWidgets.git] / src / msw / listbox.cpp
index 52fe4d0c4d5b1d3475418eac61f5693bf8e8fa79..97bbe9284072a0717466fe8c4cb7386b681b1b0d 100644 (file)
@@ -351,7 +351,11 @@ void wxListBox::DoSetSelection(int N, bool select)
 
     if ( HasMultipleSelection() )
     {
-        SendMessage(GetHwnd(), LB_SETSEL, select, N);
+        // Setting selection to -1 should deselect everything.
+        const bool deselectAll = N == wxNOT_FOUND;
+        SendMessage(GetHwnd(), LB_SETSEL,
+                    deselectAll ? FALSE : select,
+                    deselectAll ? -1 : N);
     }
     else
     {