Always call LISTVIEW_SetSelection() for an item, even if that item
has been selected before, in order to let other items get erased.
This commit is contained in:
parent
618ce03ed3
commit
2b5d9c6e50
|
@ -1887,6 +1887,12 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
|
|||
{
|
||||
if (descr->style & LBS_EXTENDEDSEL)
|
||||
{
|
||||
/* we should perhaps make sure that all items are deselected
|
||||
FIXME: needed for !LBS_EXTENDEDSEL, too ?
|
||||
if (!(wParam & (MK_SHIFT|MK_CONTROL)))
|
||||
LISTBOX_SetSelection( wnd, descr, -1, FALSE, FALSE);
|
||||
*/
|
||||
|
||||
if (!(wParam & MK_SHIFT)) descr->anchor_item = index;
|
||||
if (wParam & MK_CONTROL)
|
||||
{
|
||||
|
|
|
@ -7887,16 +7887,16 @@ static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (ListView_GetItemState(hwnd, nItem, LVIS_SELECTED) & LVIS_SELECTED
|
||||
&& infoPtr->nEditLabelItem == -1)
|
||||
BOOL was_selected =
|
||||
(ListView_GetItemState(hwnd, nItem, LVIS_SELECTED) & LVIS_SELECTED);
|
||||
|
||||
/* set selection (clears other pre-existing selections) */
|
||||
LISTVIEW_SetSelection(hwnd, nItem);
|
||||
|
||||
if (was_selected && infoPtr->nEditLabelItem == -1)
|
||||
{
|
||||
infoPtr->nEditLabelItem = nItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
LISTVIEW_SetSelection(hwnd, nItem);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue