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
da419d80
Commit
da419d80
authored
Nov 14, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Nov 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Simplify handling of the marquee highlight.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
418c1d32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
51 deletions
+31
-51
listview.c
dlls/comctl32/listview.c
+31
-51
No files found.
dlls/comctl32/listview.c
View file @
da419d80
...
...
@@ -3843,33 +3843,44 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, INT x, INT y)
* None.
*/
static
void
LISTVIEW_MarqueeHighlight
(
LISTVIEW_INFO
*
infoPtr
,
const
POINT
*
coords_orig
,
const
POINT
*
coords_offs
,
const
POINT
*
offset
,
INT
scroll
)
{
BOOL
controlDown
=
FALSE
;
LVITEMW
item
;
ITERATOR
old_elems
,
new_elems
;
RECT
rect
;
POINT
coords_offs
,
offset
;
if
(
coords_offs
->
x
>
infoPtr
->
marqueeOrigin
.
x
)
/* Ensure coordinates are within client bounds */
coords_offs
.
x
=
max
(
min
(
coords_orig
->
x
,
infoPtr
->
rcList
.
right
),
0
);
coords_offs
.
y
=
max
(
min
(
coords_orig
->
y
,
infoPtr
->
rcList
.
bottom
),
0
);
/* Get offset */
LISTVIEW_GetOrigin
(
infoPtr
,
&
offset
);
/* Offset coordinates by the appropriate amount */
coords_offs
.
x
-=
offset
.
x
;
coords_offs
.
y
-=
offset
.
y
;
if
(
coords_offs
.
x
>
infoPtr
->
marqueeOrigin
.
x
)
{
rect
.
left
=
infoPtr
->
marqueeOrigin
.
x
;
rect
.
right
=
coords_offs
->
x
;
rect
.
right
=
coords_offs
.
x
;
}
else
{
rect
.
left
=
coords_offs
->
x
;
rect
.
left
=
coords_offs
.
x
;
rect
.
right
=
infoPtr
->
marqueeOrigin
.
x
;
}
if
(
coords_offs
->
y
>
infoPtr
->
marqueeOrigin
.
y
)
if
(
coords_offs
.
y
>
infoPtr
->
marqueeOrigin
.
y
)
{
rect
.
top
=
infoPtr
->
marqueeOrigin
.
y
;
rect
.
bottom
=
coords_offs
->
y
;
rect
.
bottom
=
coords_offs
.
y
;
}
else
{
rect
.
top
=
coords_offs
->
y
;
rect
.
top
=
coords_offs
.
y
;
rect
.
bottom
=
infoPtr
->
marqueeOrigin
.
y
;
}
...
...
@@ -3895,7 +3906,7 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coord
infoPtr
->
marqueeRect
=
rect
;
infoPtr
->
marqueeDrawRect
=
rect
;
OffsetRect
(
&
infoPtr
->
marqueeDrawRect
,
offset
->
x
,
offset
->
y
);
OffsetRect
(
&
infoPtr
->
marqueeDrawRect
,
offset
.
x
,
offset
.
y
);
iterator_frameditems_absolute
(
&
new_elems
,
infoPtr
,
&
infoPtr
->
marqueeRect
);
iterator_remove_common_items
(
&
old_elems
,
&
new_elems
);
...
...
@@ -3960,9 +3971,7 @@ static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent
{
LISTVIEW_INFO
*
infoPtr
;
SCROLLINFO
scrollInfo
;
POINT
coords_orig
;
POINT
coords_offs
;
POINT
offset
;
POINT
coords
;
INT
scroll
=
0
;
infoPtr
=
(
LISTVIEW_INFO
*
)
idEvent
;
...
...
@@ -3971,19 +3980,8 @@ static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent
return
;
/* Get the current cursor position and convert to client coordinates */
GetCursorPos
(
&
coords_orig
);
ScreenToClient
(
hWnd
,
&
coords_orig
);
/* Ensure coordinates are within client bounds */
coords_offs
.
x
=
max
(
min
(
coords_orig
.
x
,
infoPtr
->
rcList
.
right
),
0
);
coords_offs
.
y
=
max
(
min
(
coords_orig
.
y
,
infoPtr
->
rcList
.
bottom
),
0
);
/* Get offset */
LISTVIEW_GetOrigin
(
infoPtr
,
&
offset
);
/* Offset coordinates by the appropriate amount */
coords_offs
.
x
-=
offset
.
x
;
coords_offs
.
y
-=
offset
.
y
;
GetCursorPos
(
&
coords
);
ScreenToClient
(
hWnd
,
&
coords
);
scrollInfo
.
cbSize
=
sizeof
(
SCROLLINFO
);
scrollInfo
.
fMask
=
SIF_ALL
;
...
...
@@ -4007,12 +4005,12 @@ static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent
scroll
|=
SCROLL_RIGHT
;
}
if
(((
coords
_orig
.
x
<=
0
)
&&
(
scroll
&
SCROLL_LEFT
))
||
((
coords
_orig
.
y
<=
0
)
&&
(
scroll
&
SCROLL_UP
))
||
((
coords
_orig
.
x
>=
infoPtr
->
rcList
.
right
)
&&
(
scroll
&
SCROLL_RIGHT
))
||
((
coords
_orig
.
y
>=
infoPtr
->
rcList
.
bottom
)
&&
(
scroll
&
SCROLL_DOWN
)))
if
(((
coords
.
x
<=
0
)
&&
(
scroll
&
SCROLL_LEFT
))
||
((
coords
.
y
<=
0
)
&&
(
scroll
&
SCROLL_UP
))
||
((
coords
.
x
>=
infoPtr
->
rcList
.
right
)
&&
(
scroll
&
SCROLL_RIGHT
))
||
((
coords
.
y
>=
infoPtr
->
rcList
.
bottom
)
&&
(
scroll
&
SCROLL_DOWN
)))
{
LISTVIEW_MarqueeHighlight
(
infoPtr
,
&
coords
_orig
,
&
coords_offs
,
&
offset
,
scroll
);
LISTVIEW_MarqueeHighlight
(
infoPtr
,
&
coords
,
scroll
);
}
}
...
...
@@ -4034,6 +4032,9 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
RECT
rect
;
POINT
pt
;
pt
.
x
=
x
;
pt
.
y
=
y
;
if
(
!
(
fwKeys
&
MK_LBUTTON
))
infoPtr
->
bLButtonDown
=
FALSE
;
...
...
@@ -4046,24 +4047,6 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
if
(
infoPtr
->
bMarqueeSelect
)
{
POINT
coords_orig
;
POINT
coords_offs
;
POINT
offset
;
coords_orig
.
x
=
x
;
coords_orig
.
y
=
y
;
/* Get offset */
LISTVIEW_GetOrigin
(
infoPtr
,
&
offset
);
/* Ensure coordinates are within client bounds */
coords_offs
.
x
=
max
(
min
(
x
,
infoPtr
->
rcList
.
right
),
0
);
coords_offs
.
y
=
max
(
min
(
y
,
infoPtr
->
rcList
.
bottom
),
0
);
/* Offset coordinates by the appropriate amount */
coords_offs
.
x
-=
offset
.
x
;
coords_offs
.
y
-=
offset
.
y
;
/* Enable the timer if we're going outside our bounds, in case the user doesn't
move the mouse again */
...
...
@@ -4082,13 +4065,10 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
KillTimer
(
infoPtr
->
hwndSelf
,
(
UINT_PTR
)
infoPtr
);
}
LISTVIEW_MarqueeHighlight
(
infoPtr
,
&
coords_orig
,
&
coords_offs
,
&
offse
t
,
0
);
LISTVIEW_MarqueeHighlight
(
infoPtr
,
&
p
t
,
0
);
return
0
;
}
pt
.
x
=
x
;
pt
.
y
=
y
;
ht
.
pt
=
pt
;
LISTVIEW_HitTest
(
infoPtr
,
&
ht
,
TRUE
,
TRUE
);
...
...
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