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
2f65a833
Commit
2f65a833
authored
Mar 26, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Move partially visible months painting outside of calendar loop.
parent
ddab5d85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
42 deletions
+45
-42
monthcal.c
dlls/comctl32/monthcal.c
+45
-42
No files found.
dlls/comctl32/monthcal.c
View file @
2f65a833
...
...
@@ -946,6 +946,46 @@ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc,
}
}
/* months before first calendar month and after last calendar month */
static
void
MONTHCAL_PaintLeadTrailMonths
(
const
MONTHCAL_INFO
*
infoPtr
,
HDC
hdc
,
const
PAINTSTRUCT
*
ps
)
{
INT
prev_month
,
mask
,
length
;
SYSTEMTIME
st_max
,
st
;
if
(
infoPtr
->
dwStyle
&
MCS_NOTRAILINGDATES
)
return
;
SetTextColor
(
hdc
,
infoPtr
->
colors
[
MCSC_TRAILINGTEXT
]);
prev_month
=
infoPtr
->
calendars
[
0
].
month
.
wMonth
-
1
;
/* draw prev month */
MONTHCAL_GetMinDate
(
infoPtr
,
&
st
);
mask
=
1
<<
(
st
.
wDay
-
1
);
/* December and January both 31 days long, so no worries if wrapped */
length
=
MONTHCAL_MonthLength
(
infoPtr
->
calendars
[
0
].
month
.
wMonth
-
1
,
infoPtr
->
calendars
[
0
].
month
.
wYear
);
while
(
st
.
wDay
<=
length
)
{
MONTHCAL_DrawDay
(
infoPtr
,
hdc
,
&
st
,
infoPtr
->
monthdayState
[
0
]
&
mask
,
ps
);
mask
<<=
1
;
st
.
wDay
++
;
}
/* draw next month */
st
=
infoPtr
->
calendars
[
infoPtr
->
cal_num
-
1
].
month
;
st
.
wDay
=
1
;
MONTHCAL_GetNextMonth
(
&
st
);
MONTHCAL_GetMaxDate
(
infoPtr
,
&
st_max
);
mask
=
1
;
while
(
st
.
wDay
<=
st_max
.
wDay
)
{
MONTHCAL_DrawDay
(
infoPtr
,
hdc
,
&
st
,
infoPtr
->
monthdayState
[
2
]
&
mask
,
ps
);
mask
<<=
1
;
st
.
wDay
++
;
}
}
/* paint a calendar area */
static
void
MONTHCAL_PaintCalendar
(
const
MONTHCAL_INFO
*
infoPtr
,
HDC
hdc
,
const
PAINTSTRUCT
*
ps
,
INT
calIdx
)
{
...
...
@@ -978,7 +1018,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const
infoPtr
->
calendars
[
calIdx
].
wdays
.
left
=
infoPtr
->
calendars
[
calIdx
].
days
.
left
=
infoPtr
->
calendars
[
calIdx
].
weeknums
.
right
;
/*
1.
draw day abbreviations */
/* draw day abbreviations */
SelectObject
(
hdc
,
infoPtr
->
hFont
);
SetBkColor
(
hdc
,
infoPtr
->
colors
[
MCSC_MONTHBK
]);
SetTextColor
(
hdc
,
infoPtr
->
colors
[
MCSC_TRAILINGTEXT
]);
...
...
@@ -993,47 +1033,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const
OffsetRect
(
&
r
,
infoPtr
->
width_increment
,
0
);
}
/* 2. previous and next months */
if
(
!
(
infoPtr
->
dwStyle
&
MCS_NOTRAILINGDATES
)
&&
(
calIdx
==
0
||
calIdx
==
infoPtr
->
cal_num
-
1
))
{
SYSTEMTIME
st_max
;
SetTextColor
(
hdc
,
infoPtr
->
colors
[
MCSC_TRAILINGTEXT
]);
/* draw prev month */
if
(
calIdx
==
0
)
{
MONTHCAL_GetMinDate
(
infoPtr
,
&
st
);
mask
=
1
<<
(
st
.
wDay
-
1
);
length
=
MONTHCAL_MonthLength
(
prev_month
,
date
->
wYear
);
while
(
st
.
wDay
<=
length
)
{
MONTHCAL_DrawDay
(
infoPtr
,
hdc
,
&
st
,
infoPtr
->
monthdayState
[
0
]
&
mask
,
ps
);
mask
<<=
1
;
st
.
wDay
++
;
}
}
/* draw next month */
if
(
calIdx
==
infoPtr
->
cal_num
-
1
)
{
st
=
*
date
;
st
.
wDay
=
1
;
MONTHCAL_GetNextMonth
(
&
st
);
MONTHCAL_GetMaxDate
(
infoPtr
,
&
st_max
);
mask
=
1
;
while
(
st
.
wDay
<=
st_max
.
wDay
)
{
MONTHCAL_DrawDay
(
infoPtr
,
hdc
,
&
st
,
infoPtr
->
monthdayState
[
2
]
&
mask
,
ps
);
mask
<<=
1
;
st
.
wDay
++
;
}
}
}
/* 3. current month */
/* draw current month */
SetTextColor
(
hdc
,
infoPtr
->
colors
[
MCSC_TEXT
]);
st
=
*
date
;
st
.
wDay
=
1
;
...
...
@@ -1075,6 +1075,9 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT
MONTHCAL_PaintWeeknumbers
(
infoPtr
,
hdc
,
ps
,
i
);
}
/* partially visible months */
MONTHCAL_PaintLeadTrailMonths
(
infoPtr
,
hdc
,
ps
);
/* focus and today rectangle */
MONTHCAL_PaintFocusAndCircle
(
infoPtr
,
hdc
,
ps
);
...
...
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