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
86e4d1cd
Commit
86e4d1cd
authored
Jul 07, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Fix hittesting for "small" positive Y coordinates.
parent
faebaa57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
+30
-16
listview.c
dlls/comctl32/listview.c
+21
-7
listview.c
dlls/comctl32/tests/listview.c
+9
-9
No files found.
dlls/comctl32/listview.c
View file @
86e4d1cd
...
...
@@ -6814,6 +6814,16 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
/* LVM_SUBITEMHITTEST checks left bound of possible client area */
if
(
infoPtr
->
rcList
.
left
>
lpht
->
pt
.
x
&&
Origin
.
x
<
lpht
->
pt
.
x
)
lpht
->
flags
|=
LVHT_TOLEFT
;
if
(
lpht
->
pt
.
y
<
infoPtr
->
rcList
.
top
&&
lpht
->
pt
.
y
>=
0
)
opt
.
y
=
lpht
->
pt
.
y
+
infoPtr
->
rcList
.
top
;
else
opt
.
y
=
lpht
->
pt
.
y
;
if
(
infoPtr
->
rcList
.
top
>
opt
.
y
)
lpht
->
flags
|=
LVHT_ABOVE
;
else
if
(
infoPtr
->
rcList
.
bottom
<
opt
.
y
)
lpht
->
flags
|=
LVHT_BELOW
;
}
else
{
...
...
@@ -6821,12 +6831,12 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
lpht
->
flags
|=
LVHT_TOLEFT
;
else
if
(
infoPtr
->
rcList
.
right
<
lpht
->
pt
.
x
)
lpht
->
flags
|=
LVHT_TORIGHT
;
if
(
infoPtr
->
rcList
.
top
>
lpht
->
pt
.
y
)
lpht
->
flags
|=
LVHT_ABOVE
;
else
if
(
infoPtr
->
rcList
.
bottom
<
lpht
->
pt
.
y
)
lpht
->
flags
|=
LVHT_BELOW
;
}
if
(
infoPtr
->
rcList
.
top
>
lpht
->
pt
.
y
)
lpht
->
flags
|=
LVHT_ABOVE
;
else
if
(
infoPtr
->
rcList
.
bottom
<
lpht
->
pt
.
y
)
lpht
->
flags
|=
LVHT_BELOW
;
/* even if item is invalid try to find subitem */
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
&&
subitem
)
...
...
@@ -6883,8 +6893,12 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
LISTVIEW_GetItemMetrics
(
infoPtr
,
&
lvItem
,
&
rcBox
,
NULL
,
&
rcIcon
,
&
rcState
,
&
rcLabel
);
LISTVIEW_GetItemOrigin
(
infoPtr
,
iItem
,
&
Position
);
opt
.
x
=
lpht
->
pt
.
x
-
Position
.
x
-
Origin
.
x
;
opt
.
y
=
lpht
->
pt
.
y
-
Position
.
y
-
Origin
.
y
;
if
(
lpht
->
pt
.
y
<
infoPtr
->
rcList
.
top
&&
lpht
->
pt
.
y
>=
0
)
opt
.
y
=
lpht
->
pt
.
y
-
Position
.
y
-
Origin
.
y
+
infoPtr
->
rcList
.
top
;
else
opt
.
y
=
lpht
->
pt
.
y
-
Position
.
y
-
Origin
.
y
;
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
{
rcBounds
=
rcBox
;
...
...
dlls/comctl32/tests/listview.c
View file @
86e4d1cd
...
...
@@ -2663,7 +2663,7 @@ static void test_hittest(void)
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
-
1
,
LVHT_TORIGHT
,
FALSE
,
TRUE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
TRUE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
/* outside possible client rectangle (to right) */
x
=
pos
.
x
+
500
;
y
=
pos
.
y
+
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
...
...
@@ -2671,7 +2671,7 @@ static void test_hittest(void)
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
-
1
,
-
1
,
LVHT_NOWHERE
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
-
1
,
LVHT_TORIGHT
,
FALSE
,
TRUE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
-
1
,
-
1
,
LVHT_NOWHERE
,
FALSE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
-
1
,
-
1
,
LVHT_NOWHERE
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
/* subitem returned with -1 item too */
x
=
pos
.
x
+
150
;
y
=
-
10
;
...
...
@@ -2684,7 +2684,7 @@ static void test_hittest(void)
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
-
1
,
LVHT_NOWHERE
,
FALSE
,
TRUE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
TRUE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
/* the same with LVS_EX_FULLROWSELECT */
SendMessage
(
hwnd
,
LVM_SETEXTENDEDLISTVIEWSTYLE
,
0
,
LVS_EX_FULLROWSELECT
);
x
=
pos
.
x
+
150
;
/* outside column */
...
...
@@ -2692,7 +2692,7 @@ static void test_hittest(void)
test_lvm_hittest
(
hwnd
,
x
,
y
,
0
,
LVHT_ONITEM
,
FALSE
,
FALSE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
TRUE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
MoveWindow
(
hwnd
,
0
,
0
,
100
,
100
,
FALSE
);
x
=
pos
.
x
+
150
;
/* outside column */
y
=
pos
.
y
+
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
...
...
@@ -2700,7 +2700,7 @@ static void test_hittest(void)
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
-
1
,
LVHT_TORIGHT
,
FALSE
,
TRUE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
TRUE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
1
,
LVHT_ONITEMLABEL
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
/* outside possible client rectangle (to right) */
x
=
pos
.
x
+
500
;
y
=
pos
.
y
+
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
...
...
@@ -2708,7 +2708,7 @@ static void test_hittest(void)
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
-
1
,
-
1
,
LVHT_NOWHERE
,
FALSE
,
FALSE
,
FALSE
,
__LINE__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_hittest
(
hwnd
,
x
,
y
,
-
1
,
LVHT_TORIGHT
,
FALSE
,
TRUE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
-
1
,
-
1
,
LVHT_NOWHERE
,
FALSE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
-
1
,
-
1
,
LVHT_NOWHERE
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
/* 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
"
);
...
...
@@ -2736,7 +2736,7 @@ static void test_hittest(void)
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__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMSTATEICON
,
TRU
E
,
FALSE
,
FALSE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMSTATEICON
,
FALS
E
,
FALSE
,
FALSE
,
__LINE__
);
/* state icons indices are 1 based, check with valid index */
item
.
mask
=
LVIF_STATE
;
...
...
@@ -2752,7 +2752,7 @@ static void test_hittest(void)
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__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMSTATEICON
,
TRU
E
,
FALSE
,
FALSE
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMSTATEICON
,
FALS
E
,
FALSE
,
FALSE
,
__LINE__
);
himl2
=
(
HIMAGELIST
)
SendMessage
(
hwnd
,
LVM_SETIMAGELIST
,
LVSIL_STATE
,
(
LPARAM
)
NULL
);
ok
(
himl2
==
himl
,
"should return handle
\n
"
);
...
...
@@ -2765,7 +2765,7 @@ static void test_hittest(void)
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__
);
y
=
(
bounds
.
bottom
-
bounds
.
top
)
/
2
;
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMICON
,
TRUE
,
FALSE
,
TRU
E
,
__LINE__
);
test_lvm_subitemhittest
(
hwnd
,
x
,
y
,
0
,
0
,
LVHT_ONITEMICON
,
FALSE
,
FALSE
,
FALS
E
,
__LINE__
);
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