Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6560d881
Commit
6560d881
authored
Jun 09, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Properly update selection mark on item state change.
parent
7f571410
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
2 deletions
+130
-2
listview.c
dlls/comctl32/listview.c
+5
-1
listview.c
dlls/comctl32/tests/listview.c
+125
-1
No files found.
dlls/comctl32/listview.c
View file @
6560d881
...
...
@@ -6,7 +6,7 @@
* Copyright 2000 Jason Mawdsley
* Copyright 2001 CodeWeavers Inc.
* Copyright 2002 Dimitrie O. Paun
* Copyright 2009-201
1
Nikolay Sivov
* Copyright 2009-201
2
Nikolay Sivov
* Copyright 2009 Owen Rudge for CodeWeavers
*
* This library is free software; you can redistribute it and/or
...
...
@@ -4276,6 +4276,10 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
{
if
(
lpLVItem
->
state
&
LVIS_FOCUSED
)
{
/* update selection mark */
if
(
infoPtr
->
nFocusedItem
==
-
1
&&
infoPtr
->
nSelectionMark
==
-
1
)
infoPtr
->
nSelectionMark
=
lpLVItem
->
iItem
;
if
(
infoPtr
->
nFocusedItem
!=
-
1
)
{
/* remove current focus */
...
...
dlls/comctl32/tests/listview.c
View file @
6560d881
...
...
@@ -2090,7 +2090,6 @@ static void test_multiselect(void)
{
"using VK_HOME"
,
-
1
,
VK_HOME
,
1
,
-
1
}
};
hwnd
=
create_listview_control
(
LVS_REPORT
);
for
(
i
=
0
;
i
<
items
;
i
++
)
{
...
...
@@ -2237,6 +2236,131 @@ static void test_multiselect(void)
r
=
ListView_GetSelectedCount
(
hwnd
);
expect
(
0
,
r
);
/* 1. selection mark is update when new focused item is set */
style
=
GetWindowLongPtrA
(
hwnd
,
GWL_STYLE
);
SetWindowLongPtrA
(
hwnd
,
GWL_STYLE
,
style
&
~
LVS_SINGLESEL
);
r
=
SendMessage
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
1
);
expect
(
-
1
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
0
,
r
);
/* it's not updated if already set */
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
1
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
0
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
1
);
expect
(
0
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
1
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
-
1
,
r
);
/* need to reset focused item first */
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
-
1
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
2
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
2
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
-
1
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
2
,
r
);
/* 2. same tests, with LVM_SETITEM */
style
=
GetWindowLongPtrA
(
hwnd
,
GWL_STYLE
);
SetWindowLongPtrA
(
hwnd
,
GWL_STYLE
,
style
&
~
LVS_SINGLESEL
);
r
=
SendMessage
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
1
);
expect
(
2
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
item
.
mask
=
LVIF_STATE
;
item
.
iItem
=
item
.
iSubItem
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
0
,
r
);
/* it's not updated if already set */
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
item
.
mask
=
LVIF_STATE
;
item
.
iItem
=
1
;
item
.
iSubItem
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
0
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
1
);
expect
(
0
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
item
.
mask
=
LVIF_STATE
;
item
.
iItem
=
1
;
item
.
iSubItem
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
-
1
,
r
);
/* need to reset focused item first */
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
-
1
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
LVIS_FOCUSED
;
item
.
mask
=
LVIF_STATE
;
item
.
iItem
=
2
;
item
.
iSubItem
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
2
,
r
);
item
.
stateMask
=
LVIS_FOCUSED
;
item
.
state
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEMSTATE
,
-
1
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
2
,
r
);
DestroyWindow
(
hwnd
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment