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
93619188
Commit
93619188
authored
Oct 06, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Oct 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Converted rcScrollBar to screen coordinates.
parent
49c1f1f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
1 deletion
+67
-1
scroll.c
dlls/user32/scroll.c
+4
-0
scroll.c
dlls/user32/tests/scroll.c
+63
-1
No files found.
dlls/user32/scroll.c
View file @
93619188
...
...
@@ -1237,6 +1237,7 @@ static BOOL SCROLL_GetScrollBarInfo(HWND hwnd, LONG idObject, LPSCROLLBARINFO in
INT
nDummy
;
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
BOOL
pressed
;
RECT
rect
;
switch
(
idObject
)
{
...
...
@@ -1252,6 +1253,9 @@ static BOOL SCROLL_GetScrollBarInfo(HWND hwnd, LONG idObject, LPSCROLLBARINFO in
SCROLL_GetScrollBarRect
(
hwnd
,
nBar
,
&
info
->
rcScrollBar
,
&
nDummy
,
&
info
->
dxyLineButton
,
&
info
->
xyThumbTop
);
/* rcScrollBar needs to be in screen coordinates */
GetWindowRect
(
hwnd
,
&
rect
);
OffsetRect
(
&
info
->
rcScrollBar
,
rect
.
left
,
rect
.
top
);
info
->
xyThumbBottom
=
info
->
xyThumbTop
+
info
->
dxyLineButton
;
...
...
dlls/user32/tests/scroll.c
View file @
93619188
...
...
@@ -127,6 +127,66 @@ static void scrollbar_test3(void)
}
static
void
scrollbar_test4
(
void
)
{
BOOL
ret
;
SCROLLBARINFO
sbi
;
RECT
rect
;
/* Test GetScrollBarInfo to make sure it returns rcScrollBar in screen
* coordinates. */
sbi
.
cbSize
=
sizeof
(
sbi
);
ret
=
GetScrollBarInfo
(
hScroll
,
OBJID_CLIENT
,
&
sbi
);
ok
(
ret
,
"The GetScrollBarInfo() call should not fail.
\n
"
);
GetWindowRect
(
hScroll
,
&
rect
);
ok
(
ret
,
"The GetWindowRect() call should not fail.
\n
"
);
ok
(
!
(
sbi
.
rgstate
[
0
]
&
(
STATE_SYSTEM_INVISIBLE
|
STATE_SYSTEM_OFFSCREEN
)),
"unexpected rgstate(0x%x)
\n
"
,
sbi
.
rgstate
[
0
]);
ok
(
EqualRect
(
&
rect
,
&
sbi
.
rcScrollBar
),
"WindowRect(%d, %d, %d, %d) != rcScrollBar(%d, %d, %d, %d)
\n
"
,
rect
.
top
,
rect
.
left
,
rect
.
bottom
,
rect
.
right
,
sbi
.
rcScrollBar
.
top
,
sbi
.
rcScrollBar
.
left
,
sbi
.
rcScrollBar
.
bottom
,
sbi
.
rcScrollBar
.
right
);
/* Test windows horizontal and vertical scrollbar to make sure rcScrollBar
* is still returned in screen coordinates by moving the window, and
* making sure that it shifts the rcScrollBar value. */
ShowWindow
(
hMainWnd
,
SW_SHOW
);
sbi
.
cbSize
=
sizeof
(
sbi
);
ret
=
GetScrollBarInfo
(
hMainWnd
,
OBJID_HSCROLL
,
&
sbi
);
ok
(
ret
,
"The GetScrollBarInfo() call should not fail.
\n
"
);
GetWindowRect
(
hMainWnd
,
&
rect
);
ok
(
ret
,
"The GetWindowRect() call should not fail.
\n
"
);
MoveWindow
(
hMainWnd
,
rect
.
left
+
5
,
rect
.
top
+
5
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
TRUE
);
rect
=
sbi
.
rcScrollBar
;
OffsetRect
(
&
rect
,
5
,
5
);
ret
=
GetScrollBarInfo
(
hMainWnd
,
OBJID_HSCROLL
,
&
sbi
);
ok
(
ret
,
"The GetScrollBarInfo() call should not fail.
\n
"
);
ok
(
EqualRect
(
&
rect
,
&
sbi
.
rcScrollBar
),
"PreviousRect(%d, %d, %d, %d) != CurrentRect(%d, %d, %d, %d)
\n
"
,
rect
.
top
,
rect
.
left
,
rect
.
bottom
,
rect
.
right
,
sbi
.
rcScrollBar
.
top
,
sbi
.
rcScrollBar
.
left
,
sbi
.
rcScrollBar
.
bottom
,
sbi
.
rcScrollBar
.
right
);
sbi
.
cbSize
=
sizeof
(
sbi
);
ret
=
GetScrollBarInfo
(
hMainWnd
,
OBJID_VSCROLL
,
&
sbi
);
ok
(
ret
,
"The GetScrollBarInfo() call should not fail.
\n
"
);
GetWindowRect
(
hMainWnd
,
&
rect
);
ok
(
ret
,
"The GetWindowRect() call should not fail.
\n
"
);
MoveWindow
(
hMainWnd
,
rect
.
left
+
5
,
rect
.
top
+
5
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
TRUE
);
rect
=
sbi
.
rcScrollBar
;
OffsetRect
(
&
rect
,
5
,
5
);
ret
=
GetScrollBarInfo
(
hMainWnd
,
OBJID_VSCROLL
,
&
sbi
);
ok
(
ret
,
"The GetScrollBarInfo() call should not fail.
\n
"
);
ok
(
EqualRect
(
&
rect
,
&
sbi
.
rcScrollBar
),
"PreviousRect(%d, %d, %d, %d) != CurrentRect(%d, %d, %d, %d)
\n
"
,
rect
.
top
,
rect
.
left
,
rect
.
bottom
,
rect
.
right
,
sbi
.
rcScrollBar
.
top
,
sbi
.
rcScrollBar
.
left
,
sbi
.
rcScrollBar
.
bottom
,
sbi
.
rcScrollBar
.
right
);
}
START_TEST
(
scroll
)
{
WNDCLASSA
wc
;
...
...
@@ -143,7 +203,8 @@ START_TEST ( scroll )
wc
.
lpfnWndProc
=
MyWndProc
;
RegisterClassA
(
&
wc
);
hMainWnd
=
CreateWindowExA
(
0
,
"MyTestWnd"
,
"Scroll"
,
WS_OVERLAPPEDWINDOW
,
hMainWnd
=
CreateWindowExA
(
0
,
"MyTestWnd"
,
"Scroll"
,
WS_OVERLAPPEDWINDOW
|
WS_VSCROLL
|
WS_HSCROLL
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
100
,
100
,
NULL
,
NULL
,
GetModuleHandleA
(
NULL
),
0
);
if
(
!
ok
(
hMainWnd
!=
NULL
,
"Failed to create parent window. Tests aborted.
\n
"
)
)
...
...
@@ -154,6 +215,7 @@ START_TEST ( scroll )
scrollbar_test1
();
scrollbar_test2
();
scrollbar_test3
();
scrollbar_test4
();
DestroyWindow
(
hScroll
);
DestroyWindow
(
hMainWnd
);
...
...
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