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
cd55d747
Commit
cd55d747
authored
Jul 14, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/trackbar: Update thumb on range change.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
099eda8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
trackbar.c
dlls/comctl32/tests/trackbar.c
+23
-0
trackbar.c
dlls/comctl32/trackbar.c
+8
-8
No files found.
dlls/comctl32/tests/trackbar.c
View file @
cd55d747
...
...
@@ -687,6 +687,7 @@ static void test_position(void)
static
void
test_range
(
void
)
{
HWND
hWndTrackbar
;
RECT
rect1
,
rect2
;
int
r
;
hWndTrackbar
=
create_trackbar
(
defaultstyle
,
hWndParent
);
...
...
@@ -752,6 +753,28 @@ static void test_range(void)
ok_sequence
(
sequences
,
TRACKBAR_SEQ_INDEX
,
range_test_seq
,
"range test sequence"
,
TRUE
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
parent_range_test_seq
,
"parent range test sequence"
,
TRUE
);
/* TBM_SETRANGE updates thumb visual position (rectangle) if needed */
r
=
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGE
,
TRUE
,
MAKELONG
(
-
10
,
0
));
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_SETPOS
,
TRUE
,
0
);
RedrawWindow
(
hWndTrackbar
,
NULL
,
0
,
RDW_UPDATENOW
);
SendMessageA
(
hWndTrackbar
,
TBM_GETTHUMBRECT
,
0
,
(
LPARAM
)
&
rect1
);
r
=
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGE
,
TRUE
,
MAKELONG
(
-
10
,
10
));
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
RedrawWindow
(
hWndTrackbar
,
NULL
,
0
,
RDW_UPDATENOW
);
SendMessageA
(
hWndTrackbar
,
TBM_GETTHUMBRECT
,
0
,
(
LPARAM
)
&
rect2
);
ok
(
!
EqualRect
(
&
rect1
,
&
rect2
),
"thumb rectangle not updated
\n
"
);
/* change range back, don't force repaint */
r
=
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGE
,
FALSE
,
MAKELONG
(
-
10
,
0
));
ok
(
r
==
0
,
"got %d
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_GETTHUMBRECT
,
0
,
(
LPARAM
)
&
rect1
);
ok
(
EqualRect
(
&
rect1
,
&
rect2
),
"thumb rectangle not updated
\n
"
);
DestroyWindow
(
hWndTrackbar
);
}
...
...
dlls/comctl32/trackbar.c
View file @
cd55d747
...
...
@@ -1245,21 +1245,21 @@ TRACKBAR_SetRange (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG range)
infoPtr
->
lRangeMin
=
(
SHORT
)
LOWORD
(
range
);
infoPtr
->
lRangeMax
=
(
SHORT
)
HIWORD
(
range
);
if
(
infoPtr
->
lPos
<
infoPtr
->
lRangeMin
)
{
/* clip position to new min/max limit */
if
(
infoPtr
->
lPos
<
infoPtr
->
lRangeMin
)
infoPtr
->
lPos
=
infoPtr
->
lRangeMin
;
infoPtr
->
flags
|=
TB_THUMBPOSCHANGED
;
}
if
(
infoPtr
->
lPos
>
infoPtr
->
lRangeMax
)
{
if
(
infoPtr
->
lPos
>
infoPtr
->
lRangeMax
)
infoPtr
->
lPos
=
infoPtr
->
lRangeMax
;
infoPtr
->
flags
|=
TB_THUMBPOSCHANGED
;
}
infoPtr
->
lPageSize
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
5
;
if
(
infoPtr
->
lPageSize
==
0
)
infoPtr
->
lPageSize
=
1
;
if
(
changed
&&
(
infoPtr
->
dwStyle
&
TBS_AUTOTICKS
))
TRACKBAR_RecalculateTics
(
infoPtr
);
if
(
changed
)
{
if
(
infoPtr
->
dwStyle
&
TBS_AUTOTICKS
)
TRACKBAR_RecalculateTics
(
infoPtr
);
infoPtr
->
flags
|=
TB_THUMBPOSCHANGED
;
}
if
(
redraw
)
TRACKBAR_InvalidateAll
(
infoPtr
);
...
...
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