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
49088bf9
Commit
49088bf9
authored
Apr 02, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Fix today label position and text colour.
parent
5a8be0bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
37 deletions
+47
-37
monthcal.c
dlls/comctl32/monthcal.c
+47
-37
No files found.
dlls/comctl32/monthcal.c
View file @
49088bf9
...
...
@@ -636,28 +636,33 @@ static BOOL MONTHCAL_SetDayFocus(MONTHCAL_INFO *infoPtr, const SYSTEMTIME *st)
return
TRUE
;
}
/* draw today boundary box for specified rectangle */
static
void
MONTHCAL_Circle
(
const
MONTHCAL_INFO
*
infoPtr
,
HDC
hdc
,
const
RECT
*
r
)
{
HPEN
red_pen
=
CreatePen
(
PS_SOLID
,
1
,
RGB
(
255
,
0
,
0
));
HPEN
old_pen
=
SelectObject
(
hdc
,
red_pen
);
HBRUSH
old_brush
;
old_brush
=
SelectObject
(
hdc
,
GetStockObject
(
NULL_BRUSH
));
Rectangle
(
hdc
,
r
->
left
,
r
->
top
,
r
->
right
,
r
->
bottom
);
SelectObject
(
hdc
,
old_brush
);
DeleteObject
(
red_pen
);
SelectObject
(
hdc
,
old_pen
);
}
/* Draw today day mark rectangle
*
* [I] hdc : context to draw in
* [I] da
y
: day to mark with rectangle
* [I] hdc
: context to draw in
* [I] da
te
: day to mark with rectangle
*
*/
static
void
MONTHCAL_CircleDay
(
const
MONTHCAL_INFO
*
infoPtr
,
HDC
hdc
,
const
SYSTEMTIME
*
date
)
{
HPEN
hRedPen
=
CreatePen
(
PS_SOLID
,
1
,
RGB
(
255
,
0
,
0
));
HPEN
hOldPen2
=
SelectObject
(
hdc
,
hRedPen
);
HBRUSH
hOldBrush
;
RECT
day_rect
;
MONTHCAL_CalcPosFromDay
(
infoPtr
,
date
,
&
day_rect
);
hOldBrush
=
SelectObject
(
hdc
,
GetStockObject
(
NULL_BRUSH
));
Rectangle
(
hdc
,
day_rect
.
left
,
day_rect
.
top
,
day_rect
.
right
,
day_rect
.
bottom
);
SelectObject
(
hdc
,
hOldBrush
);
DeleteObject
(
hRedPen
);
SelectObject
(
hdc
,
hOldPen2
);
MONTHCAL_Circle
(
infoPtr
,
hdc
,
&
day_rect
);
}
static
void
MONTHCAL_DrawDay
(
const
MONTHCAL_INFO
*
infoPtr
,
HDC
hdc
,
const
SYSTEMTIME
*
st
,
...
...
@@ -885,36 +890,41 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con
/* bottom today date */
static
void
MONTHCAL_PaintTodayTitle
(
const
MONTHCAL_INFO
*
infoPtr
,
HDC
hdc
,
const
PAINTSTRUCT
*
ps
)
{
if
(
!
(
infoPtr
->
dwStyle
&
MCS_NOTODAY
))
{
static
const
WCHAR
fmt_todayW
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
's'
,
0
};
WCHAR
buf_todayW
[
30
],
buf_dateW
[
20
],
buf
[
80
];
RECT
text_rect
,
box_rect
;
HFONT
old_font
;
INT
col
;
if
(
infoPtr
->
dwStyle
&
MCS_NOTODAY
)
return
;
if
(
!
LoadStringW
(
COMCTL32_hModule
,
IDM_TODAY
,
buf_todayW
,
countof
(
buf_todayW
)))
{
static
const
WCHAR
todayW
[]
=
{
'T'
,
'o'
,
'd'
,
'a'
,
'y'
,
':'
,
0
};
static
const
WCHAR
fmt_todayW
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
's'
,
0
}
;
WCHAR
buf_todayW
[
30
],
buf_dateW
[
20
],
buf
[
80
]
;
RECT
rtoday
;
WARN
(
"Can't load resource
\n
"
)
;
strcpyW
(
buf_todayW
,
todayW
)
;
}
if
(
!
(
infoPtr
->
dwStyle
&
MCS_NOTODAYCIRCLE
))
{
SYSTEMTIME
fake_st
;
col
=
infoPtr
->
dwStyle
&
MCS_NOTODAYCIRCLE
?
0
:
1
;
if
(
infoPtr
->
dwStyle
&
MCS_WEEKNUMBERS
)
col
--
;
MONTHCAL_CalcDayRect
(
infoPtr
,
&
text_rect
,
col
,
6
);
box_rect
=
text_rect
;
MONTHCAL_GetMaxDate
(
infoPtr
,
&
fake_st
);
/* this is always safe cause next month will never fully fit calendar */
fake_st
.
wDay
+=
1
;
MONTHCAL_CircleDay
(
infoPtr
,
hdc
,
&
fake_st
);
}
if
(
!
LoadStringW
(
COMCTL32_hModule
,
IDM_TODAY
,
buf_todayW
,
countof
(
buf_todayW
)))
{
WARN
(
"Can't load resource
\n
"
);
strcpyW
(
buf_todayW
,
todayW
);
}
MONTHCAL_CalcDayRect
(
infoPtr
,
&
rtoday
,
1
,
6
);
GetDateFormatW
(
LOCALE_USER_DEFAULT
,
DATE_SHORTDATE
,
&
infoPtr
->
todaysDate
,
NULL
,
buf_dateW
,
countof
(
buf_dateW
));
SelectObject
(
hdc
,
infoPtr
->
hBoldFont
);
GetDateFormatW
(
LOCALE_USER_DEFAULT
,
DATE_SHORTDATE
,
&
infoPtr
->
todaysDate
,
NULL
,
buf_dateW
,
countof
(
buf_dateW
));
old_font
=
SelectObject
(
hdc
,
infoPtr
->
hBoldFont
);
SetTextColor
(
hdc
,
infoPtr
->
colors
[
MCSC_TEXT
]);
wsprintfW
(
buf
,
fmt_todayW
,
buf_todayW
,
buf_dateW
);
DrawTextW
(
hdc
,
buf
,
-
1
,
&
rtoday
,
DT_CALCRECT
|
DT_LEFT
|
DT_VCENTER
|
DT_SINGLELINE
);
DrawTextW
(
hdc
,
buf
,
-
1
,
&
rtoday
,
DT_LEFT
|
DT_VCENTER
|
DT_SINGLELINE
);
wsprintfW
(
buf
,
fmt_todayW
,
buf_todayW
,
buf_dateW
);
DrawTextW
(
hdc
,
buf
,
-
1
,
&
text_rect
,
DT_CALCRECT
|
DT_LEFT
|
DT_VCENTER
|
DT_SINGLELINE
);
DrawTextW
(
hdc
,
buf
,
-
1
,
&
text_rect
,
DT_LEFT
|
DT_VCENTER
|
DT_SINGLELINE
);
SelectObject
(
hdc
,
infoPtr
->
hFont
);
if
(
!
(
infoPtr
->
dwStyle
&
MCS_NOTODAYCIRCLE
))
{
OffsetRect
(
&
box_rect
,
-
infoPtr
->
width_increment
,
0
);
MONTHCAL_Circle
(
infoPtr
,
hdc
,
&
box_rect
);
}
SelectObject
(
hdc
,
old_font
);
}
/* today mark + focus */
...
...
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