[1/2] comctl32: Implement highlighting (marquee) selection support in listview
bunglehead at gmail.com
Mon Sep 14 14:33:19 CDT 2009
Owen Rudge wrote:
> These patches add support for selecting multiple items in a
> multi-selection listview using the mouse (by dragging and highlighting).
> dlls/comctl32/listview.c | 172
> 1 files changed, 157 insertions(+), 15 deletions(-)
@@ -201,6 +201,7 @@ typedef struct tagITEM_INFO
+ UINT orig_state; /* state before highlighting operation begins */
Why do you need this restoring code?
If you're starting selection box with some items selected they should be
deselected if not Shift pressed and
leaved untouched if Shift used. I don't see a reason to restore it -
when you want to toggle selected state
moving rectangle with Ctrl pressed you could just:
LISTVIEW_GetItemState() and place inverted state with following
Also such large cycles shouldn't be used if you could manage not to use
Currently we're not doing right sometimes with ownerdata lists which
leads to huge response times
Anyway this part:
+ /* Take a snapshot of all the item states */
+ for (i = 0; i < infoPtr->nItemCount; i++)
+ hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i);
+ lpItem = DPA_GetPtr(hdpaSubItems, 0);
+ if (lpItem)
+ lpItem->orig_state = lpItem->state;
is wrong. You can't do it that way cause selected state could also be cached at
parent side with corresponding callback bit set (look at LISTVIEW_GetItemT()).
P.S. No need to split in two patches here, fist is useless if we can't see rectangle.
More information about the wine-devel