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
07f86907
Commit
07f86907
authored
Aug 03, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Aug 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add hottracking support for the header control.
parent
50cd0e02
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
5 deletions
+41
-5
header.c
dlls/comctl32/header.c
+41
-5
No files found.
dlls/comctl32/header.c
View file @
07f86907
...
...
@@ -416,7 +416,7 @@ HEADER_RefreshItem (HWND hwnd, HDC hdc, INT iItem)
hFont
=
infoPtr
->
hFont
?
infoPtr
->
hFont
:
GetStockObject
(
SYSTEM_FONT
);
hOldFont
=
SelectObject
(
hdc
,
hFont
);
HEADER_DrawItem
(
hwnd
,
hdc
,
iItem
,
FALSE
);
HEADER_DrawItem
(
hwnd
,
hdc
,
iItem
,
infoPtr
->
iHotItem
==
iItem
);
SelectObject
(
hdc
,
hOldFont
);
}
...
...
@@ -1580,6 +1580,22 @@ HEADER_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
static
LRESULT
HEADER_MouseLeave
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
/* Reset hot-tracked item when mouse leaves control. */
INT
oldHotItem
=
infoPtr
->
iHotItem
;
HDC
hdc
=
GetDC
(
hwnd
);
infoPtr
->
iHotItem
=
-
1
;
if
(
oldHotItem
!=
-
1
)
HEADER_RefreshItem
(
hwnd
,
hdc
,
oldHotItem
);
ReleaseDC
(
hwnd
,
hdc
);
return
0
;
}
static
LRESULT
HEADER_MouseMove
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
...
...
@@ -1588,28 +1604,35 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
UINT
flags
;
INT
nItem
,
nWidth
;
HDC
hdc
;
/* With theming, hottracking is always enabled */
BOOL
hotTrackEnabled
=
((
dwStyle
&
HDS_BUTTONS
)
&&
(
dwStyle
&
HDS_HOTTRACK
))
||
(
GetWindowTheme
(
hwnd
)
!=
NULL
);
INT
oldHotItem
=
infoPtr
->
iHotItem
;
pt
.
x
=
(
INT
)(
SHORT
)
LOWORD
(
lParam
);
pt
.
y
=
(
INT
)(
SHORT
)
HIWORD
(
lParam
);
HEADER_InternalHitTest
(
hwnd
,
&
pt
,
&
flags
,
&
nItem
);
if
(
(
dwStyle
&
HDS_BUTTONS
)
&&
(
dwStyle
&
HDS_HOTTRACK
)
)
{
if
(
hotTrackEnabled
)
{
if
(
flags
&
(
HHT_ONHEADER
|
HHT_ONDIVIDER
|
HHT_ONDIVOPEN
))
infoPtr
->
iHotItem
=
nItem
;
else
infoPtr
->
iHotItem
=
-
1
;
InvalidateRect
(
hwnd
,
NULL
,
FALSE
);
}
if
(
infoPtr
->
bCaptured
)
{
if
(
infoPtr
->
bPressed
)
{
BOOL
oldState
=
infoPtr
->
items
[
infoPtr
->
iMoveItem
].
bDown
;
if
((
nItem
==
infoPtr
->
iMoveItem
)
&&
(
flags
==
HHT_ONHEADER
))
infoPtr
->
items
[
infoPtr
->
iMoveItem
].
bDown
=
TRUE
;
else
infoPtr
->
items
[
infoPtr
->
iMoveItem
].
bDown
=
FALSE
;
if
(
oldState
!=
infoPtr
->
items
[
infoPtr
->
iMoveItem
].
bDown
)
{
hdc
=
GetDC
(
hwnd
);
HEADER_RefreshItem
(
hwnd
,
hdc
,
infoPtr
->
iMoveItem
);
ReleaseDC
(
hwnd
,
hdc
);
}
TRACE
(
"Moving pressed item %d!
\n
"
,
infoPtr
->
iMoveItem
);
}
...
...
@@ -1642,8 +1665,18 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
if
((
dwStyle
&
HDS_BUTTONS
)
&&
(
dwStyle
&
HDS_HOTTRACK
))
{
FIXME
(
"hot track support!
\n
"
);
if
(
hotTrackEnabled
)
{
TRACKMOUSEEVENT
tme
;
if
(
oldHotItem
!=
infoPtr
->
iHotItem
)
{
hdc
=
GetDC
(
hwnd
);
if
(
oldHotItem
!=
-
1
)
HEADER_RefreshItem
(
hwnd
,
hdc
,
oldHotItem
);
if
(
infoPtr
->
iHotItem
!=
-
1
)
HEADER_RefreshItem
(
hwnd
,
hdc
,
infoPtr
->
iHotItem
);
ReleaseDC
(
hwnd
,
hdc
);
}
tme
.
cbSize
=
sizeof
(
tme
);
tme
.
dwFlags
=
TME_LEAVE
;
tme
.
hwndTrack
=
hwnd
;
TrackMouseEvent
(
&
tme
);
}
return
0
;
...
...
@@ -1853,6 +1886,9 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case
WM_LBUTTONUP
:
return
HEADER_LButtonUp
(
hwnd
,
wParam
,
lParam
);
case
WM_MOUSELEAVE
:
return
HEADER_MouseLeave
(
hwnd
,
wParam
,
lParam
);
case
WM_MOUSEMOVE
:
return
HEADER_MouseMove
(
hwnd
,
wParam
,
lParam
);
...
...
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