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
ce12717c
Commit
ce12717c
authored
May 24, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Fix returning LVHT_ONITEMSTATEICON flag on hittesting.
parent
c46a5141
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
listview.c
dlls/comctl32/listview.c
+1
-1
listview.c
dlls/comctl32/tests/listview.c
+23
-5
No files found.
dlls/comctl32/listview.c
View file @
ce12717c
...
...
@@ -6593,7 +6593,7 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
lpht
->
flags
|=
LVHT_ONITEMICON
;
else
if
(
PtInRect
(
&
rcLabel
,
opt
))
lpht
->
flags
|=
LVHT_ONITEMLABEL
;
else
if
(
infoPtr
->
himlState
&&
STATEIMAGEINDEX
(
lvItem
.
state
)
&&
PtInRect
(
&
rcState
,
opt
))
else
if
(
infoPtr
->
himlState
&&
PtInRect
(
&
rcState
,
opt
))
lpht
->
flags
|=
LVHT_ONITEMSTATEICON
;
/* special case for LVS_EX_FULLROWSELECT */
if
(
uView
==
LVS_REPORT
&&
infoPtr
->
dwLvExStyle
&
LVS_EX_FULLROWSELECT
&&
...
...
dlls/comctl32/tests/listview.c
View file @
ce12717c
...
...
@@ -2389,13 +2389,17 @@ static void test_hittest(void)
y
=
pos
.
y
+
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
-
1
,
LVHT_TORIGHT
,
FALSE
,
FALSE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
TRUE
,
TRUE
,
TRUE
,
__LINE__
);
/* try with icons */
/* try with icons
, state icons index is 1 based so at least 2 bitmaps needed
*/
himl
=
ImageList_Create
(
16
,
16
,
0
,
4
,
4
);
ok
(
himl
!=
NULL
,
"failed to create imagelist
\n
"
);
hbmp
=
CreateBitmap
(
16
,
16
,
1
,
1
,
NULL
);
ok
(
hbmp
!=
NULL
,
"failed to create bitmap
\n
"
);
r
=
ImageList_Add
(
himl
,
hbmp
,
0
);
ok
(
r
==
0
,
"should be zero
\n
"
);
hbmp
=
CreateBitmap
(
16
,
16
,
1
,
1
,
NULL
);
ok
(
hbmp
!=
NULL
,
"failed to create bitmap
\n
"
);
r
=
ImageList_Add
(
himl
,
hbmp
,
0
);
ok
(
r
==
1
,
"should be one
\n
"
);
r
=
SendMessage
(
hwnd
,
LVM_SETIMAGELIST
,
LVSIL_STATE
,
(
LPARAM
)
himl
);
ok
(
r
==
0
,
"should return zero
\n
"
);
...
...
@@ -2407,10 +2411,24 @@ static void test_hittest(void)
r
=
SendMessage
(
hwnd
,
LVM_SETITEM
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
/* on state icon */
x
=
pos
.
x
+
8
;
/* outside column */
x
=
pos
.
x
+
8
;
y
=
pos
.
y
+
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
0
,
LVHT_ONITEMSTATEICON
,
FALSE
,
FALSE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMSTATEICON
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
/* state icons indices are 1 based, check with valid index */
item
.
mask
=
LVIF_STATE
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
1
);
item
.
stateMask
=
LVIS_STATEIMAGEMASK
;
item
.
iItem
=
0
;
item
.
iSubItem
=
0
;
r
=
SendMessage
(
hwnd
,
LVM_SETITEM
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
/* on state icon */
x
=
pos
.
x
+
8
;
y
=
pos
.
y
+
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
0
,
LVHT_ONITEMSTATEICON
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMSTATEICON
,
FALSE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_hittest
(
hwnd
,
x
,
y
,
0
,
LVHT_ONITEMSTATEICON
,
FALSE
,
FALS
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMSTATEICON
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
himl2
=
(
HIMAGELIST
)
SendMessage
(
hwnd
,
LVM_SETIMAGELIST
,
LVSIL_STATE
,
(
LPARAM
)
NULL
);
ok
(
himl2
==
himl
,
"should return handle
\n
"
);
...
...
@@ -2418,7 +2436,7 @@ static void test_hittest(void)
r
=
SendMessage
(
hwnd
,
LVM_SETIMAGELIST
,
LVSIL_SMALL
,
(
LPARAM
)
himl
);
ok
(
r
==
0
,
"should return zero
\n
"
);
/* on item icon */
x
=
pos
.
x
+
8
;
/* outside column */
x
=
pos
.
x
+
8
;
y
=
pos
.
y
+
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
0
,
LVHT_ONITEMICON
,
FALSE
,
FALSE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMICON
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
...
...
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