Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ecf89c7e
Commit
ecf89c7e
authored
Oct 11, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Fix selection during navigation with prev/next buttons.
parent
c9e3e3bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
41 deletions
+39
-41
monthcal.c
dlls/comctl32/monthcal.c
+39
-41
No files found.
dlls/comctl32/monthcal.c
View file @
ecf89c7e
...
@@ -1520,10 +1520,12 @@ MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, SYSTEMTIME *range)
...
@@ -1520,10 +1520,12 @@ MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, SYSTEMTIME *range)
infoPtr
->
minSel
=
range
[
1
];
infoPtr
->
minSel
=
range
[
1
];
infoPtr
->
maxSel
=
range
[
0
];
infoPtr
->
maxSel
=
range
[
0
];
}
}
infoPtr
->
curSel
=
infoPtr
->
minSel
;
/* update day of week */
/* update day of week */
MONTHCAL_CalculateDayOfWeek
(
&
infoPtr
->
minSel
,
TRUE
);
MONTHCAL_CalculateDayOfWeek
(
&
infoPtr
->
minSel
,
TRUE
);
MONTHCAL_CalculateDayOfWeek
(
&
infoPtr
->
maxSel
,
TRUE
);
MONTHCAL_CalculateDayOfWeek
(
&
infoPtr
->
maxSel
,
TRUE
);
MONTHCAL_CalculateDayOfWeek
(
&
infoPtr
->
curSel
,
TRUE
);
/* redraw if bounds changed */
/* redraw if bounds changed */
/* FIXME: no actual need to redraw everything */
/* FIXME: no actual need to redraw everything */
...
@@ -1725,35 +1727,42 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
...
@@ -1725,35 +1727,42 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
}
}
}
}
static
void
MONTHCAL_GoTo
NextMonth
(
MONTHCAL_INFO
*
infoPtr
)
static
void
MONTHCAL_GoTo
PrevNextMonth
(
MONTHCAL_INFO
*
infoPtr
,
BOOL
prev
)
{
{
SYSTEMTIME
next
=
infoPtr
->
curSel
;
SYSTEMTIME
st
=
infoPtr
->
curSel
;
TRACE
(
"
\n
"
);
MONTHCAL_GetNextMonth
(
&
next
);
if
(
!
MONTHCAL_IsDateInValidRange
(
infoPtr
,
&
next
,
FALSE
))
return
;
infoPtr
->
curSel
=
next
;
MONTHCAL_NotifyDayState
(
infoPtr
);
TRACE
(
"%s
\n
"
,
prev
?
"prev"
:
"next"
);
}
if
(
prev
)
MONTHCAL_GetPrevMonth
(
&
st
);
else
MONTHCAL_GetNextMonth
(
&
st
);
static
void
MONTHCAL_GoToPrevMonth
(
MONTHCAL_INFO
*
infoPtr
)
if
(
!
MONTHCAL_IsDateInValidRange
(
infoPtr
,
&
st
,
FALSE
))
return
;
{
SYSTEMTIME
prev
=
infoPtr
->
curSel
;
TRACE
(
"
\n
"
);
if
(
infoPtr
->
dwStyle
&
MCS_MULTISELECT
)
{
SYSTEMTIME
range
[
2
];
MONTHCAL_GetPrevMonth
(
&
prev
);
range
[
0
]
=
infoPtr
->
minSel
;
range
[
1
]
=
infoPtr
->
maxSel
;
if
(
!
MONTHCAL_IsDateInValidRange
(
infoPtr
,
&
prev
,
FALSE
))
return
;
if
(
prev
)
{
MONTHCAL_GetPrevMonth
(
&
range
[
0
]);
MONTHCAL_GetPrevMonth
(
&
range
[
1
]);
}
else
{
MONTHCAL_GetNextMonth
(
&
range
[
0
]);
MONTHCAL_GetNextMonth
(
&
range
[
1
]);
}
infoPtr
->
curSel
=
prev
;
MONTHCAL_SetSelRange
(
infoPtr
,
range
);
}
else
MONTHCAL_SetCurSel
(
infoPtr
,
&
st
);
MONTHCAL_NotifyDayState
(
infoPtr
);
MONTHCAL_NotifyDayState
(
infoPtr
);
MONTHCAL_NotifySelectionChange
(
infoPtr
);
}
}
static
LRESULT
static
LRESULT
...
@@ -1892,14 +1901,14 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
...
@@ -1892,14 +1901,14 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
switch
(
hit
)
switch
(
hit
)
{
{
case
MCHT_TITLEBTNNEXT
:
case
MCHT_TITLEBTNNEXT
:
MONTHCAL_GoTo
NextMonth
(
infoPtr
);
MONTHCAL_GoTo
PrevNextMonth
(
infoPtr
,
FALSE
);
infoPtr
->
status
=
MC_NEXTPRESSED
;
infoPtr
->
status
=
MC_NEXTPRESSED
;
SetTimer
(
infoPtr
->
hwndSelf
,
MC_PREVNEXTMONTHTIMER
,
MC_PREVNEXTMONTHDELAY
,
0
);
SetTimer
(
infoPtr
->
hwndSelf
,
MC_PREVNEXTMONTHTIMER
,
MC_PREVNEXTMONTHDELAY
,
0
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
return
0
;
return
0
;
case
MCHT_TITLEBTNPREV
:
case
MCHT_TITLEBTNPREV
:
MONTHCAL_GoToPrev
Month
(
infoPtr
);
MONTHCAL_GoToPrev
NextMonth
(
infoPtr
,
TRUE
);
infoPtr
->
status
=
MC_PREVPRESSED
;
infoPtr
->
status
=
MC_PREVPRESSED
;
SetTimer
(
infoPtr
->
hwndSelf
,
MC_PREVNEXTMONTHTIMER
,
MC_PREVNEXTMONTHDELAY
,
0
);
SetTimer
(
infoPtr
->
hwndSelf
,
MC_PREVNEXTMONTHTIMER
,
MC_PREVNEXTMONTHDELAY
,
0
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
...
@@ -1951,17 +1960,13 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
...
@@ -1951,17 +1960,13 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
case
MCHT_CALENDARDATEPREV
:
case
MCHT_CALENDARDATEPREV
:
case
MCHT_CALENDARDATE
:
case
MCHT_CALENDARDATE
:
{
{
MONTHCAL_CopyDate
(
&
ht
.
st
,
&
infoPtr
->
firstSel
);
SYSTEMTIME
st
[
2
];
if
(
infoPtr
->
dwStyle
&
MCS_MULTISELECT
)
{
SYSTEMTIME
st
[
2
];
st
[
0
]
=
st
[
1
]
=
ht
.
st
;
MONTHCAL_CopyDate
(
&
ht
.
st
,
&
infoPtr
->
firstSel
)
;
/* clear selection range */
st
[
0
]
=
st
[
1
]
=
ht
.
st
;
MONTHCAL_SetSelRange
(
infoPtr
,
st
);
/* clear selection range */
}
MONTHCAL_SetSelRange
(
infoPtr
,
st
);
infoPtr
->
status
=
MC_SEL_LBUTDOWN
;
infoPtr
->
status
=
MC_SEL_LBUTDOWN
;
MONTHCAL_SetDayFocus
(
infoPtr
,
&
ht
.
st
);
MONTHCAL_SetDayFocus
(
infoPtr
,
&
ht
.
st
);
...
@@ -2016,15 +2021,8 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
...
@@ -2016,15 +2021,8 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
{
{
SYSTEMTIME
sel
=
infoPtr
->
curSel
;
SYSTEMTIME
sel
=
infoPtr
->
curSel
;
if
(
!
(
infoPtr
->
dwStyle
&
MCS_MULTISELECT
))
/* will be invalidated here */
{
MONTHCAL_SetCurSel
(
infoPtr
,
&
ht
.
st
);
SYSTEMTIME
st
[
2
];
st
[
0
]
=
st
[
1
]
=
ht
.
st
;
MONTHCAL_SetSelRange
(
infoPtr
,
st
);
/* will be invalidated here */
MONTHCAL_SetCurSel
(
infoPtr
,
&
st
[
0
]);
}
/* send MCN_SELCHANGE only if new date selected */
/* send MCN_SELCHANGE only if new date selected */
if
(
!
MONTHCAL_IsDateEqual
(
&
sel
,
&
ht
.
st
))
if
(
!
MONTHCAL_IsDateEqual
(
&
sel
,
&
ht
.
st
))
...
@@ -2044,8 +2042,8 @@ MONTHCAL_Timer(MONTHCAL_INFO *infoPtr, WPARAM id)
...
@@ -2044,8 +2042,8 @@ MONTHCAL_Timer(MONTHCAL_INFO *infoPtr, WPARAM id)
switch
(
id
)
{
switch
(
id
)
{
case
MC_PREVNEXTMONTHTIMER
:
case
MC_PREVNEXTMONTHTIMER
:
if
(
infoPtr
->
status
&
MC_NEXTPRESSED
)
MONTHCAL_GoTo
NextMonth
(
infoPtr
);
if
(
infoPtr
->
status
&
MC_NEXTPRESSED
)
MONTHCAL_GoTo
PrevNextMonth
(
infoPtr
,
FALSE
);
if
(
infoPtr
->
status
&
MC_PREVPRESSED
)
MONTHCAL_GoToPrev
Month
(
infoPtr
);
if
(
infoPtr
->
status
&
MC_PREVPRESSED
)
MONTHCAL_GoToPrev
NextMonth
(
infoPtr
,
TRUE
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
break
;
break
;
case
MC_TODAYUPDATETIMER
:
case
MC_TODAYUPDATETIMER
:
...
...
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