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
af6ba829
Commit
af6ba829
authored
Aug 08, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Properly scroll calendars on year change.
parent
23d8d35e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
monthcal.c
dlls/comctl32/monthcal.c
+16
-18
No files found.
dlls/comctl32/monthcal.c
View file @
af6ba829
...
...
@@ -457,11 +457,10 @@ int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace)
/* add/substract 'months' from date */
static
inline
void
MONTHCAL_GetMonth
(
SYSTEMTIME
*
date
,
INT
months
)
{
INT
length
;
INT
length
,
m
=
date
->
wMonth
+
months
;
date
->
wMonth
+=
months
;
date
->
wYear
+=
date
->
wMonth
>
0
?
(
date
->
wMonth
-
1
)
/
12
:
date
->
wMonth
/
12
-
1
;
date
->
wMonth
=
date
->
wMonth
>
0
?
(
date
->
wMonth
-
1
)
%
12
+
1
:
12
+
date
->
wMonth
%
12
;
date
->
wYear
+=
m
>
0
?
(
m
-
1
)
/
12
:
m
/
12
-
1
;
date
->
wMonth
=
m
>
0
?
(
m
-
1
)
%
12
+
1
:
12
+
m
%
12
;
/* fix moving from last day in a month */
length
=
MONTHCAL_MonthLength
(
date
->
wMonth
,
date
->
wYear
);
if
(
date
->
wDay
>
length
)
date
->
wDay
=
length
;
...
...
@@ -1957,12 +1956,15 @@ static LRESULT CALLBACK EditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
}
/* creates updown control and edit box */
static
void
MONTHCAL_EditYear
(
MONTHCAL_INFO
*
infoPtr
)
static
void
MONTHCAL_EditYear
(
MONTHCAL_INFO
*
infoPtr
,
INT
calIdx
)
{
RECT
*
rc
=
&
infoPtr
->
calendars
[
calIdx
].
titleyear
;
RECT
*
title
=
&
infoPtr
->
calendars
[
calIdx
].
title
;
infoPtr
->
hWndYearEdit
=
CreateWindowExW
(
0
,
WC_EDITW
,
0
,
WS_VISIBLE
|
WS_CHILD
|
ES_READONLY
,
infoPtr
->
calendars
[
0
].
titleyear
.
left
+
3
,
infoPtr
->
titlebtnnext
.
top
,
infoPtr
->
calendars
[
0
].
titleyear
.
right
-
infoPtr
->
calendars
[
0
].
titleyear
.
left
+
4
,
rc
->
left
+
3
,
(
title
->
bottom
+
title
->
top
-
infoPtr
->
textHeight
)
/
2
,
rc
->
right
-
rc
->
left
+
4
,
infoPtr
->
textHeight
,
infoPtr
->
hwndSelf
,
NULL
,
NULL
,
NULL
);
...
...
@@ -1971,7 +1973,7 @@ static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr)
infoPtr
->
hWndYearUpDown
=
CreateWindowExW
(
0
,
UPDOWN_CLASSW
,
0
,
WS_VISIBLE
|
WS_CHILD
|
UDS_SETBUDDYINT
|
UDS_NOTHOUSANDS
|
UDS_ARROWKEYS
,
infoPtr
->
calendars
[
0
].
titleyear
.
right
+
7
,
infoPtr
->
titlebtnnext
.
top
,
rc
->
right
+
7
,
(
title
->
bottom
+
title
->
top
-
infoPtr
->
textHeight
)
/
2
,
18
,
infoPtr
->
textHeight
,
infoPtr
->
hwndSelf
,
NULL
,
NULL
,
NULL
);
...
...
@@ -1979,7 +1981,7 @@ static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr)
SendMessageW
(
infoPtr
->
hWndYearUpDown
,
UDM_SETRANGE
,
0
,
MAKELONG
(
max_allowed_date
.
wYear
,
min_allowed_date
.
wYear
));
SendMessageW
(
infoPtr
->
hWndYearUpDown
,
UDM_SETBUDDY
,
(
WPARAM
)
infoPtr
->
hWndYearEdit
,
0
);
SendMessageW
(
infoPtr
->
hWndYearUpDown
,
UDM_SETPOS
,
0
,
infoPtr
->
minSel
.
wYear
);
SendMessageW
(
infoPtr
->
hWndYearUpDown
,
UDM_SETPOS
,
0
,
infoPtr
->
calendars
[
calIdx
].
month
.
wYear
);
/* subclass edit box */
infoPtr
->
EditWndProc
=
(
WNDPROC
)
SetWindowLongPtrW
(
infoPtr
->
hWndYearEdit
,
...
...
@@ -2068,7 +2070,7 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
}
case
MCHT_TITLEYEAR
:
{
MONTHCAL_EditYear
(
infoPtr
);
MONTHCAL_EditYear
(
infoPtr
,
ht
.
iOffset
);
return
0
;
}
case
MCHT_TODAYLINK
:
...
...
@@ -2631,16 +2633,12 @@ MONTHCAL_Notify(MONTHCAL_INFO *infoPtr, NMHDR *hdr)
{
NMUPDOWN
*
nmud
=
(
NMUPDOWN
*
)
hdr
;
if
(
hdr
->
hwndFrom
==
infoPtr
->
hWndYearUpDown
)
if
(
hdr
->
hwndFrom
==
infoPtr
->
hWndYearUpDown
&&
nmud
->
iDelta
)
{
/* year value limits are set up explicitly after updown creation */
if
((
nmud
->
iDelta
+
nmud
->
iPos
)
!=
infoPtr
->
minSel
.
wYear
)
{
SYSTEMTIME
new_date
=
infoPtr
->
minSel
;
new_date
.
wYear
=
nmud
->
iDelta
+
nmud
->
iPos
;
MONTHCAL_SetCurSel
(
infoPtr
,
&
new_date
);
}
MONTHCAL_Scroll
(
infoPtr
,
12
*
nmud
->
iDelta
);
MONTHCAL_NotifyDayState
(
infoPtr
);
MONTHCAL_NotifySelectionChange
(
infoPtr
);
}
}
return
0
;
...
...
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