So should ListView check to see if the selected ranges *really*
changed, or
should I perform that check in the app by looking at the
previousSelectedRanges argument?
Just a little more background info - we intentionally don't check for
an actual change here, in the same way that we don't check for a
change when setting a Label's text property - the overhead of the
check just isn't justified. We could efficiently check for a change in
setSelectedIndex(), but that would create an inconsistency between
setSelectedIndex() and setSelectedRanges() (to which
setSelectedIndex() is currently a pass-through).
So I'm thinking that, if the user clicks on an item that is already
selected and the list view doesn't currently have focus, we do
nothing. If the list view does have focus, we have to call
setSelectedIndex(), or users would never be able to change the
selection.
However, if the user clicks on an item that isn't already selected, we
would call setSelectedIndex() regardless of the selection state.
Thoughts?