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
6dc3c6ba
Commit
6dc3c6ba
authored
May 05, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/trackbar: Don't update page size if it was explicitly set.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e95d0c68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
16 deletions
+67
-16
trackbar.c
dlls/comctl32/tests/trackbar.c
+41
-0
trackbar.c
dlls/comctl32/trackbar.c
+26
-16
No files found.
dlls/comctl32/tests/trackbar.c
View file @
6dc3c6ba
...
...
@@ -577,6 +577,47 @@ static void test_page_size(void)
hWndTrackbar
=
create_trackbar
(
defaultstyle
,
hWndParent
);
ok
(
hWndTrackbar
!=
NULL
,
"Expected non NULL value
\n
"
);
r
=
SendMessageA
(
hWndTrackbar
,
TBM_GETPAGESIZE
,
0
,
0
);
ok
(
r
==
20
,
"Unexpected page size %d.
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGE
,
0
,
MAKELPARAM
(
0
,
65
));
r
=
SendMessageA
(
hWndTrackbar
,
TBM_GETPAGESIZE
,
0
,
0
);
ok
(
r
==
13
,
"Unexpected page size %d.
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGEMIN
,
0
,
10
);
r
=
SendMessageA
(
hWndTrackbar
,
TBM_GETPAGESIZE
,
0
,
0
);
ok
(
r
==
11
,
"Unexpected page size %d.
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGEMAX
,
0
,
50
);
r
=
SendMessageA
(
hWndTrackbar
,
TBM_GETPAGESIZE
,
0
,
0
);
ok
(
r
==
8
,
"Unexpected page size %d.
\n
"
,
r
);
r
=
SendMessageA
(
hWndTrackbar
,
TBM_SETPAGESIZE
,
0
,
10
);
ok
(
r
==
8
,
"Unexpected page size %d.
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGE
,
0
,
MAKELPARAM
(
0
,
30
));
r
=
SendMessageA
(
hWndTrackbar
,
TBM_GETPAGESIZE
,
0
,
0
);
ok
(
r
==
10
,
"Unexpected page size %d.
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGEMIN
,
0
,
5
);
r
=
SendMessageA
(
hWndTrackbar
,
TBM_GETPAGESIZE
,
0
,
0
);
ok
(
r
==
10
,
"Unexpected page size %d.
\n
"
,
r
);
SendMessageA
(
hWndTrackbar
,
TBM_SETRANGEMAX
,
0
,
40
);
r
=
SendMessageA
(
hWndTrackbar
,
TBM_GETPAGESIZE
,
0
,
0
);
ok
(
r
==
10
,
"Unexpected page size %d.
\n
"
,
r
);
DestroyWindow
(
hWndTrackbar
);
hWndTrackbar
=
create_trackbar
(
defaultstyle
,
hWndParent
);
ok
(
hWndTrackbar
!=
NULL
,
"Failed to create trackbar window.
\n
"
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCE
);
/* test TBM_SETPAGESIZE */
...
...
dlls/comctl32/trackbar.c
View file @
6dc3c6ba
...
...
@@ -59,7 +59,7 @@ typedef struct
HWND
hwndBuddyLA
;
HWND
hwndBuddyRB
;
INT
fLocation
;
INT
flags
;
DWORD
flags
;
BOOL
bUnicode
;
BOOL
bFocussed
;
RECT
rcChannel
;
...
...
@@ -78,15 +78,18 @@ typedef struct
/* Used by TRACKBAR_Refresh to find out which parts of the control
need to be recalculated */
#define TB_THUMBPOSCHANGED 1
#define TB_THUMBSIZECHANGED 2
#define TB_THUMBCHANGED (TB_THUMBPOSCHANGED | TB_THUMBSIZECHANGED)
#define TB_SELECTIONCHANGED 4
#define TB_DRAG_MODE 8
/* we're dragging the slider */
#define TB_AUTO_PAGE_LEFT 16
#define TB_AUTO_PAGE_RIGHT 32
#define TB_AUTO_PAGE (TB_AUTO_PAGE_LEFT | TB_AUTO_PAGE_RIGHT)
#define TB_THUMB_HOT 64
/* mouse hovers above thumb */
#define TB_THUMBPOSCHANGED 0x00000001
#define TB_THUMBSIZECHANGED 0x00000002
#define TB_THUMBCHANGED (TB_THUMBPOSCHANGED | TB_THUMBSIZECHANGED)
#define TB_SELECTIONCHANGED 0x00000004
#define TB_DRAG_MODE 0x00000008
/* we're dragging the slider */
#define TB_AUTO_PAGE_LEFT 0x00000010
#define TB_AUTO_PAGE_RIGHT 0x00000020
#define TB_AUTO_PAGE (TB_AUTO_PAGE_LEFT | TB_AUTO_PAGE_RIGHT)
#define TB_THUMB_HOT 0x00000040
/* mouse hovers above thumb */
/* Page was set with TBM_SETPAGESIZE */
#define TB_USER_PAGE 0x00000080
/* helper defines for TRACKBAR_DrawTic */
#define TIC_EDGE 0x20
...
...
@@ -1204,6 +1207,8 @@ TRACKBAR_SetPageSize (TRACKBAR_INFO *infoPtr, LONG lPageSize)
else
infoPtr
->
lPageSize
=
TB_DEFAULTPAGESIZE
;
infoPtr
->
flags
|=
TB_USER_PAGE
;
return
lTemp
;
}
...
...
@@ -1229,6 +1234,14 @@ TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
return
0
;
}
static
void
TRACKBAR_UpdatePageSize
(
TRACKBAR_INFO
*
infoPtr
)
{
if
(
infoPtr
->
flags
&
TB_USER_PAGE
)
return
;
infoPtr
->
lPageSize
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
5
;
if
(
infoPtr
->
lPageSize
==
0
)
infoPtr
->
lPageSize
=
1
;
}
static
inline
LRESULT
TRACKBAR_SetRange
(
TRACKBAR_INFO
*
infoPtr
,
BOOL
redraw
,
LONG
range
)
...
...
@@ -1246,8 +1259,7 @@ TRACKBAR_SetRange (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG range)
if
(
infoPtr
->
lPos
>
infoPtr
->
lRangeMax
)
infoPtr
->
lPos
=
infoPtr
->
lRangeMax
;
infoPtr
->
lPageSize
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
5
;
if
(
infoPtr
->
lPageSize
==
0
)
infoPtr
->
lPageSize
=
1
;
TRACKBAR_UpdatePageSize
(
infoPtr
);
if
(
changed
)
{
if
(
infoPtr
->
dwStyle
&
TBS_AUTOTICKS
)
...
...
@@ -1273,8 +1285,7 @@ TRACKBAR_SetRangeMax (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMax)
infoPtr
->
flags
|=
TB_THUMBPOSCHANGED
;
}
infoPtr
->
lPageSize
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
5
;
if
(
infoPtr
->
lPageSize
==
0
)
infoPtr
->
lPageSize
=
1
;
TRACKBAR_UpdatePageSize
(
infoPtr
);
if
(
changed
&&
(
infoPtr
->
dwStyle
&
TBS_AUTOTICKS
))
TRACKBAR_RecalculateTics
(
infoPtr
);
...
...
@@ -1296,8 +1307,7 @@ TRACKBAR_SetRangeMin (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMin)
infoPtr
->
flags
|=
TB_THUMBPOSCHANGED
;
}
infoPtr
->
lPageSize
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
5
;
if
(
infoPtr
->
lPageSize
==
0
)
infoPtr
->
lPageSize
=
1
;
TRACKBAR_UpdatePageSize
(
infoPtr
);
if
(
changed
&&
(
infoPtr
->
dwStyle
&
TBS_AUTOTICKS
))
TRACKBAR_RecalculateTics
(
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