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
3df08230
Commit
3df08230
authored
Oct 01, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Changing MCS_MULTISELECT isn't allowed after creation, set…
comctl32/monthcal: Changing MCS_MULTISELECT isn't allowed after creation, set default value properly.
parent
eb87332f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletion
+55
-1
monthcal.c
dlls/comctl32/monthcal.c
+22
-1
monthcal.c
dlls/comctl32/tests/monthcal.c
+33
-0
No files found.
dlls/comctl32/monthcal.c
View file @
3df08230
...
...
@@ -1937,6 +1937,24 @@ static INT MONTHCAL_StyleChanged(MONTHCAL_INFO *infoPtr, WPARAM wStyleType,
return
0
;
}
static
INT
MONTHCAL_StyleChanging
(
MONTHCAL_INFO
*
infoPtr
,
WPARAM
wStyleType
,
STYLESTRUCT
*
lpss
)
{
TRACE
(
"(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)
\n
"
,
wStyleType
,
lpss
->
styleOld
,
lpss
->
styleNew
);
/* block MCS_MULTISELECT change */
if
((
lpss
->
styleNew
^
lpss
->
styleOld
)
&
MCS_MULTISELECT
)
{
if
(
lpss
->
styleOld
&
MCS_MULTISELECT
)
lpss
->
styleNew
|=
MCS_MULTISELECT
;
else
lpss
->
styleNew
&=
~
MCS_MULTISELECT
;
}
return
0
;
}
/* FIXME: check whether dateMin/dateMax need to be adjusted. */
static
LRESULT
MONTHCAL_Create
(
HWND
hwnd
,
LPCREATESTRUCTW
lpcs
)
...
...
@@ -1965,7 +1983,7 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
infoPtr
->
firstDayHighWord
=
FALSE
;
MONTHCAL_SetFirstDayOfWeek
(
infoPtr
,
-
1
);
infoPtr
->
maxSelCount
=
7
;
infoPtr
->
maxSelCount
=
(
infoPtr
->
dwStyle
&
MCS_MULTISELECT
)
?
7
:
1
;
infoPtr
->
monthRange
=
3
;
infoPtr
->
monthdayState
=
Alloc
(
infoPtr
->
monthRange
*
sizeof
(
MONTHDAYSTATE
));
infoPtr
->
titlebk
=
comctl32_color
.
clrActiveCaption
;
...
...
@@ -2131,6 +2149,9 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
WM_STYLECHANGED
:
return
MONTHCAL_StyleChanged
(
infoPtr
,
wParam
,
(
LPSTYLESTRUCT
)
lParam
);
case
WM_STYLECHANGING
:
return
MONTHCAL_StyleChanging
(
infoPtr
,
wParam
,
(
LPSTYLESTRUCT
)
lParam
);
default:
if
((
uMsg
>=
WM_USER
)
&&
(
uMsg
<
WM_APP
)
&&
!
COMCTL32_IsReflectedMessage
(
uMsg
))
ERR
(
"unknown msg %04x wp=%08lx lp=%08lx
\n
"
,
uMsg
,
wParam
,
lParam
);
...
...
dlls/comctl32/tests/monthcal.c
View file @
3df08230
...
...
@@ -580,6 +580,14 @@ static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wPa
msg
.
lParam
=
lParam
;
add_message
(
sequences
,
MONTHCAL_SEQ_INDEX
,
&
msg
);
/* some debug output for style changing */
if
((
message
==
WM_STYLECHANGING
||
message
==
WM_STYLECHANGED
)
&&
lParam
)
{
STYLESTRUCT
*
style
=
(
STYLESTRUCT
*
)
lParam
;
trace
(
"
\t
old style: 0x%08x, new style: 0x%08x
\n
"
,
style
->
styleOld
,
style
->
styleNew
);
}
defwndproc_counter
++
;
ret
=
CallWindowProcA
(
info
->
oldproc
,
hwnd
,
message
,
wParam
,
lParam
);
defwndproc_counter
--
;
...
...
@@ -1302,8 +1310,33 @@ static void test_monthcal_maxselday(void)
{
int
res
;
HWND
hwnd
;
DWORD
style
;
hwnd
=
create_monthcal_control
(
0
);
/* if no style specified default to 1 */
res
=
SendMessage
(
hwnd
,
MCM_GETMAXSELCOUNT
,
0
,
0
);
expect
(
1
,
res
);
/* try to set style */
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
SetWindowLong
(
hwnd
,
GWL_STYLE
,
style
|
MCS_MULTISELECT
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
MCS_MULTISELECT
),
"Expected MCS_MULTISELECT not to be set
\n
"
);
DestroyWindow
(
hwnd
);
hwnd
=
create_monthcal_control
(
MCS_MULTISELECT
);
/* try to remove style */
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
SetWindowLong
(
hwnd
,
GWL_STYLE
,
style
&
~
MCS_MULTISELECT
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
MCS_MULTISELECT
,
"Expected MCS_MULTISELECT to be set
\n
"
);
DestroyWindow
(
hwnd
);
hwnd
=
create_monthcal_control
(
MCS_MULTISELECT
);
/* default width is a week */
res
=
SendMessage
(
hwnd
,
MCM_GETMAXSELCOUNT
,
0
,
0
);
expect
(
7
,
res
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
...
...
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