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
3ce8e208
Commit
3ce8e208
authored
Apr 20, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Some tests for LVS_SINGLESEL switchover.
parent
0588ba7f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
listview.c
dlls/comctl32/listview.c
+0
-1
listview.c
dlls/comctl32/tests/listview.c
+55
-0
commctrl.h
include/commctrl.h
+1
-1
No files found.
dlls/comctl32/listview.c
View file @
3ce8e208
...
...
@@ -9566,7 +9566,6 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
if
(
wStyleType
!=
GWL_STYLE
)
return
0
;
/* FIXME: if LVS_NOSORTHEADER changed, update header */
/* or LVS_SINGLESEL */
/* or LVS_SORT{AS,DES}CENDING */
infoPtr
->
dwStyle
=
lpss
->
styleNew
;
...
...
dlls/comctl32/tests/listview.c
View file @
3ce8e208
...
...
@@ -1351,6 +1351,7 @@ static void test_multiselect(void)
static
const
int
items
=
5
;
BYTE
kstate
[
256
];
select_task
task
;
LONG_PTR
style
;
static
struct
t_select_task
task_list
[]
=
{
{
"using VK_DOWN"
,
0
,
VK_DOWN
,
-
1
,
-
1
},
...
...
@@ -1407,6 +1408,60 @@ static void test_multiselect(void)
SetKeyboardState
(
kstate
);
}
DestroyWindow
(
hwnd
);
/* make multiple selection, then switch to LVS_SINGLESEL */
hwnd
=
create_listview_control
(
0
);
for
(
i
=
0
;
i
<
items
;
i
++
)
{
insert_item
(
hwnd
,
0
);
}
item_count
=
(
int
)
SendMessage
(
hwnd
,
LVM_GETITEMCOUNT
,
0
,
0
);
expect
(
items
,
item_count
);
/* deselect all items */
ListView_SetItemState
(
hwnd
,
-
1
,
0
,
LVIS_SELECTED
);
SendMessage
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
1
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
ListView_SetItemState
(
hwnd
,
i
,
LVIS_SELECTED
,
LVIS_SELECTED
);
}
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
expect
(
3
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
todo_wine
expect
(
-
1
,
r
);
style
=
GetWindowLongPtrA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
LVS_SINGLESEL
),
"LVS_SINGLESEL isn't expected
\n
"
);
SetWindowLongPtrA
(
hwnd
,
GWL_STYLE
,
style
|
LVS_SINGLESEL
);
/* check that style is accepted */
style
=
GetWindowLongPtrA
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
LVS_SINGLESEL
,
"LVS_SINGLESEL expected
\n
"
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
r
=
ListView_GetItemState
(
hwnd
,
i
,
LVIS_SELECTED
);
ok
(
r
&
LVIS_SELECTED
,
"Expected item %d to be selected
\n
"
,
i
);
}
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
expect
(
3
,
r
);
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
expect
(
3
,
r
);
/* select one more */
ListView_SetItemState
(
hwnd
,
3
,
LVIS_SELECTED
,
LVIS_SELECTED
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
r
=
ListView_GetItemState
(
hwnd
,
i
,
LVIS_SELECTED
);
ok
(
!
(
r
&
LVIS_SELECTED
),
"Expected item %d to be unselected
\n
"
,
i
);
}
r
=
ListView_GetItemState
(
hwnd
,
3
,
LVIS_SELECTED
);
ok
(
r
&
LVIS_SELECTED
,
"Expected item %d to be selected
\n
"
,
i
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
expect
(
1
,
r
);
r
=
SendMessage
(
hwnd
,
LVM_GETSELECTIONMARK
,
0
,
0
);
todo_wine
expect
(
-
1
,
r
);
DestroyWindow
(
hwnd
);
}
static
void
test_subitem_rect
(
void
)
...
...
include/commctrl.h
View file @
3ce8e208
...
...
@@ -3715,7 +3715,7 @@ typedef struct NMLVSCROLL
{ LVITEMA _LVi; _LVi.state = data; _LVi.stateMask = dataMask;\
SNDMSGA(hwnd, LVM_SETITEMSTATE, (WPARAM)(UINT)i, (LPARAM) (LPLVITEMA)&_LVi);}
#define ListView_GetItemState(hwnd,i,mask) \
(
BOOL
)SNDMSGA((hwnd),LVM_GETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(UINT)(mask))
(
UINT
)SNDMSGA((hwnd),LVM_GETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(UINT)(mask))
#define ListView_GetCountPerPage(hwnd) \
(BOOL)SNDMSGW((hwnd),LVM_GETCOUNTPERPAGE,0,0L)
#define ListView_GetImageList(hwnd,iImageList) \
...
...
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