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
9a58351f
Commit
9a58351f
authored
Oct 25, 2000
by
Francois Methot
Committed by
Alexandre Julliard
Oct 25, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support of blinking thumb as found in Windows scrollbar.
parent
d1082dca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
2 deletions
+67
-2
scroll.c
controls/scroll.c
+67
-2
No files found.
controls/scroll.c
View file @
9a58351f
...
...
@@ -816,6 +816,18 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
(
SCROLL_TrackingBar
==
nBar
))
SCROLL_DrawMovingThumb
(
hdc
,
&
rect
,
vertical
,
arrowSize
,
thumbSize
);
if
(
hwnd
==
GetFocus
())
/* if scroll bar has focus, reposition the caret*/
{
if
(
!
vertical
)
{
SetCaretPos
(
thumbPos
+
1
,
rect
.
top
+
1
);
}
else
{
SetCaretPos
(
rect
.
top
+
1
,
thumbPos
+
1
);
}
}
END:
WIN_ReleaseWndPtr
(
wndPtr
);
}
...
...
@@ -907,14 +919,15 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
switch
(
msg
)
{
case
WM_LBUTTONDOWN
:
/* Initialise mouse tracking */
SCROLL_trackVertical
=
vertical
;
HideCaret
(
hwnd
);
/* hide caret while holding down LBUTTON*/
SCROLL_trackVertical
=
vertical
;
SCROLL_trackHitTest
=
hittest
=
SCROLL_HitTest
(
hwnd
,
nBar
,
pt
,
FALSE
);
lastClickPos
=
vertical
?
(
pt
.
y
-
rect
.
top
)
:
(
pt
.
x
-
rect
.
left
);
lastMousePos
=
lastClickPos
;
trackThumbPos
=
thumbPos
;
prevPt
=
pt
;
SetCapture
(
hwnd
);
if
(
nBar
==
SB_CTL
)
SetFocus
(
hwnd
);
if
(
nBar
==
SB_CTL
&&
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
WS_TABSTOP
)
)
SetFocus
(
hwnd
);
break
;
case
WM_MOUSEMOVE
:
...
...
@@ -925,6 +938,8 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
case
WM_LBUTTONUP
:
hittest
=
SCROLL_NOWHERE
;
ReleaseCapture
();
/* if scrollbar has focus, show back caret */
if
(
hwnd
==
GetFocus
())
ShowCaret
(
hwnd
);
break
;
case
WM_SYSTIMER
:
...
...
@@ -1142,10 +1157,60 @@ LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
}
break
;
/* if key event is received, the scrollbar has the focus*/
case
WM_KEYDOWN
:
HideCaret
(
hwnd
);
/*hide caret to prevent flicker*/
SCROLL_HandleKbdEvent
(
hwnd
,
wParam
);
break
;
case
WM_KEYUP
:
ShowCaret
(
hwnd
);
break
;
case
WM_SETFOCUS
:
{
/* Create a caret when a ScrollBar get focus*/
RECT
rect
;
int
arrowSize
,
thumbSize
,
thumbPos
,
vertical
;
if
(
hwnd
==
GetFocus
())
{
vertical
=
SCROLL_GetScrollBarRect
(
hwnd
,
SB_CTL
,
&
rect
,
&
arrowSize
,
&
thumbSize
,
&
thumbPos
);
if
(
!
vertical
)
{
CreateCaret
(
hwnd
,
1
,
thumbSize
-
2
,
rect
.
bottom
-
rect
.
top
-
2
);
SetCaretPos
(
thumbPos
+
1
,
rect
.
top
+
1
);
}
else
{
CreateCaret
(
hwnd
,
1
,
rect
.
right
-
rect
.
left
-
2
,
thumbSize
-
2
);
SetCaretPos
(
rect
.
top
+
1
,
thumbPos
+
1
);
}
ShowCaret
(
hwnd
);
}
}
break
;
case
WM_KILLFOCUS
:
{
RECT
rect
;
int
arrowSize
,
thumbSize
,
thumbPos
,
vertical
;
vertical
=
SCROLL_GetScrollBarRect
(
hwnd
,
SB_CTL
,
&
rect
,
&
arrowSize
,
&
thumbSize
,
&
thumbPos
);
if
(
!
vertical
){
rect
.
left
=
thumbPos
+
1
;
rect
.
right
=
rect
.
left
+
thumbSize
;
}
else
{
rect
.
top
=
thumbPos
+
1
;
rect
.
bottom
=
rect
.
top
+
thumbSize
;
}
HideCaret
(
hwnd
);
InvalidateRect
(
hwnd
,
&
rect
,
0
);
DestroyCaret
();
}
break
;
case
WM_ERASEBKGND
:
return
1
;
...
...
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