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
2c928de9
Commit
2c928de9
authored
Oct 05, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Parameter fixes for MCM_SETSELRANGE handler: swap selection…
comctl32/monthcal: Parameter fixes for MCM_SETSELRANGE handler: swap selection bounds, store day of week.
parent
6d2a5e19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
5 deletions
+54
-5
monthcal.c
dlls/comctl32/monthcal.c
+19
-2
monthcal.c
dlls/comctl32/tests/monthcal.c
+35
-3
No files found.
dlls/comctl32/monthcal.c
View file @
2c928de9
...
...
@@ -1252,8 +1252,25 @@ MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, SYSTEMTIME *range)
old_range
[
0
]
=
infoPtr
->
minSel
;
old_range
[
1
]
=
infoPtr
->
maxSel
;
infoPtr
->
minSel
=
range
[
0
];
infoPtr
->
maxSel
=
range
[
1
];
/* swap if min > max */
if
(
MONTHCAL_CompareSystemTime
(
&
range
[
0
],
&
range
[
1
])
<=
0
)
{
infoPtr
->
minSel
=
range
[
0
];
infoPtr
->
maxSel
=
range
[
1
];
}
else
{
infoPtr
->
minSel
=
range
[
1
];
infoPtr
->
maxSel
=
range
[
0
];
}
/* update day of week */
infoPtr
->
minSel
.
wDayOfWeek
=
MONTHCAL_CalculateDayOfWeek
(
infoPtr
->
minSel
.
wDay
,
infoPtr
->
minSel
.
wMonth
,
infoPtr
->
minSel
.
wYear
);
infoPtr
->
maxSel
.
wDayOfWeek
=
MONTHCAL_CalculateDayOfWeek
(
infoPtr
->
maxSel
.
wDay
,
infoPtr
->
maxSel
.
wMonth
,
infoPtr
->
maxSel
.
wYear
);
/* redraw if bounds changed */
/* FIXME: no actual need to redraw everything */
...
...
dlls/comctl32/tests/monthcal.c
View file @
2c928de9
...
...
@@ -1516,10 +1516,10 @@ static void test_monthcal_destroy(void)
ok_sequence
(
sequences
,
MONTHCAL_SEQ_INDEX
,
destroy_monthcal_multi_sel_style_seq
,
"Destroy monthcal (multi sel style)"
,
FALSE
);
}
static
void
test_monthcal_
get
selrange
(
void
)
static
void
test_monthcal_selrange
(
void
)
{
HWND
hwnd
;
SYSTEMTIME
st
,
range
[
2
];
SYSTEMTIME
st
,
range
[
2
]
,
range2
[
2
]
;
BOOL
ret
,
old_comctl32
=
FALSE
;
hwnd
=
create_monthcal_control
(
MCS_MULTISELECT
);
...
...
@@ -1560,6 +1560,38 @@ static void test_monthcal_getselrange(void)
expect
(
st
.
wMilliseconds
,
range
[
1
].
wMilliseconds
);
}
/* bounds are swapped if min > max */
memset
(
&
range
[
0
],
0
,
sizeof
(
range
[
0
]));
range
[
0
].
wYear
=
2009
;
range
[
0
].
wMonth
=
10
;
range
[
0
].
wDay
=
5
;
range
[
1
]
=
range
[
0
];
range
[
1
].
wDay
=
3
;
ret
=
SendMessage
(
hwnd
,
MCM_SETSELRANGE
,
0
,
(
LPARAM
)
range
);
expect
(
TRUE
,
ret
);
ret
=
SendMessage
(
hwnd
,
MCM_GETSELRANGE
,
0
,
(
LPARAM
)
range2
);
expect
(
TRUE
,
ret
);
expect
(
range
[
1
].
wYear
,
range2
[
0
].
wYear
);
expect
(
range
[
1
].
wMonth
,
range2
[
0
].
wMonth
);
expect
(
range
[
1
].
wDay
,
range2
[
0
].
wDay
);
expect
(
6
,
range2
[
0
].
wDayOfWeek
);
expect
(
range
[
1
].
wHour
,
range2
[
0
].
wHour
);
expect
(
range
[
1
].
wMinute
,
range2
[
0
].
wMinute
);
expect
(
range
[
1
].
wSecond
,
range2
[
0
].
wSecond
);
expect
(
range
[
1
].
wMilliseconds
,
range2
[
0
].
wMilliseconds
);
expect
(
range
[
0
].
wYear
,
range2
[
1
].
wYear
);
expect
(
range
[
0
].
wMonth
,
range2
[
1
].
wMonth
);
expect
(
range
[
0
].
wDay
,
range2
[
1
].
wDay
);
expect
(
1
,
range2
[
1
].
wDayOfWeek
);
expect
(
range
[
0
].
wHour
,
range2
[
1
].
wHour
);
expect
(
range
[
0
].
wMinute
,
range2
[
1
].
wMinute
);
expect
(
range
[
0
].
wSecond
,
range2
[
1
].
wSecond
);
expect
(
range
[
0
].
wMilliseconds
,
range2
[
1
].
wMilliseconds
);
DestroyWindow
(
hwnd
);
}
...
...
@@ -1599,7 +1631,7 @@ START_TEST(monthcal)
test_monthcal_todaylink
();
test_monthcal_size
();
test_monthcal_maxselday
();
test_monthcal_
get
selrange
();
test_monthcal_selrange
();
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
DestroyWindow
(
parent_wnd
);
...
...
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