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
42c83b9d
Commit
42c83b9d
authored
Sep 02, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/trackbar: Fix tic count calculation.
parent
6be5ab78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
trackbar.c
dlls/comctl32/tests/trackbar.c
+21
-4
trackbar.c
dlls/comctl32/trackbar.c
+7
-6
No files found.
dlls/comctl32/tests/trackbar.c
View file @
42c83b9d
...
...
@@ -30,6 +30,7 @@
#define PARENT_SEQ_INDEX 0
#define TRACKBAR_SEQ_INDEX 1
HWND
hWndParent
;
static
struct
msg_sequence
*
sequences
[
NUM_MSG_SEQUENCE
];
...
...
@@ -846,9 +847,7 @@ static void test_tic_placement(HWND hWndTrackbar){
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETTIC
,
2
,
0
);
expect
(
4
,
r
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETTIC
,
4
,
0
);
todo_wine
{
expect
(
-
1
,
r
);
}
expect
(
-
1
,
r
);
/* test TBM_GETTICPIC */
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETTICPOS
,
0
,
0
);
...
...
@@ -967,11 +966,27 @@ static void test_ignore_selection(HWND hWndTrackbar){
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
parent_empty_test_seq
,
"parent ignore selection setting test sequence"
,
FALSE
);
}
static
void
test_initial_state
(
void
)
{
HWND
hWnd
;
DWORD
ret
;
hWnd
=
create_trackbar
(
0
,
hWndParent
);
ret
=
SendMessage
(
hWnd
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
2
,
ret
);
ret
=
SendMessage
(
hWnd
,
TBM_GETTIC
,
0
,
0
);
expect
(
-
1
,
ret
);
ret
=
SendMessage
(
hWnd
,
TBM_GETTICPOS
,
0
,
0
);
expect
(
-
1
,
ret
);
DestroyWindow
(
hWnd
);
}
START_TEST
(
trackbar
)
{
DWORD
style
=
WS_VISIBLE
|
TBS_TOOLTIPS
|
TBS_ENABLESELRANGE
|
TBS_FIXEDLENGTH
|
TBS_AUTOTICKS
;
HWND
hWndTrackbar
;
HWND
hWndParent
;
init_msg_sequences
(
sequences
,
NUM_MSG_SEQUENCE
);
InitCommonControls
();
...
...
@@ -1036,5 +1051,7 @@ START_TEST(trackbar)
DestroyWindow
(
hWndTrackbar
);
test_initial_state
();
DestroyWindow
(
hWndParent
);
}
dlls/comctl32/trackbar.c
View file @
42c83b9d
...
...
@@ -151,8 +151,12 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
int
tic
;
unsigned
nrTics
,
i
;
if
(
infoPtr
->
uTicFreq
&&
infoPtr
->
lRangeMax
>=
infoPtr
->
lRangeMin
)
nrTics
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
infoPtr
->
uTicFreq
;
if
(
infoPtr
->
uTicFreq
&&
infoPtr
->
lRangeMax
>=
infoPtr
->
lRangeMin
)
{
nrTics
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
infoPtr
->
uTicFreq
;
/* don't add extra tic if there's no remainder */
if
((
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
%
infoPtr
->
uTicFreq
==
0
)
nrTics
--
;
}
else
{
Free
(
infoPtr
->
tics
);
infoPtr
->
tics
=
NULL
;
...
...
@@ -1042,10 +1046,7 @@ TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr)
if
(
GetWindowLongW
(
infoPtr
->
hwndSelf
,
GWL_STYLE
)
&
TBS_NOTICKS
)
return
0
;
if
(
infoPtr
->
uNumTics
==
0
)
return
2
;
else
return
infoPtr
->
uNumTics
+
1
;
return
infoPtr
->
uNumTics
+
2
;
}
...
...
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