You've already forked lazarus-ccr
tvplanit: Fix some more drawing glitches in monthview
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8444 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -102,7 +102,7 @@ procedure TVpMonthViewPainter.DrawDayCell(ADate: TDate; ACol, ARow: Integer;
|
|||||||
var
|
var
|
||||||
tmpRect: TRect;
|
tmpRect: TRect;
|
||||||
Y, M, D: Word;
|
Y, M, D: Word;
|
||||||
Str: String;
|
str: String;
|
||||||
todayDate: TDate;
|
todayDate: TDate;
|
||||||
fontStyle: TFontStyles;
|
fontStyle: TFontStyles;
|
||||||
textAdjust: Integer;
|
textAdjust: Integer;
|
||||||
@ -150,7 +150,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Prepare the day number as string}
|
{ Prepare the day number as string}
|
||||||
Str := FormatDateTime('d', ADate);
|
str := FormatDateTime('d', ADate);
|
||||||
|
|
||||||
{ Set the proper font and style }
|
{ Set the proper font and style }
|
||||||
if ADate = todayDate then
|
if ADate = todayDate then
|
||||||
@ -190,25 +190,25 @@ begin
|
|||||||
RenderCanvas.Font.Style := FMonthView.DayNumberFont.Style;
|
RenderCanvas.Font.Style := FMonthView.DayNumberFont.Style;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FontStyle := RenderCanvas.Font.Style;
|
|
||||||
RenderCanvas.Font.Style := [fsBold, fsItalic];
|
|
||||||
textAdjust := RenderCanvas.TextWidth(Str);
|
|
||||||
textHeight := RenderCanvas.TextHeight(Str);
|
|
||||||
RenderCanvas.Font.Style := FontStyle;
|
|
||||||
if DisplayMonth <> M then
|
if DisplayMonth <> M then
|
||||||
RenderCanvas.Font.Color := FMonthView.OffDayFontColor;
|
RenderCanvas.Font.Color := FMonthView.OffDayFontColor;
|
||||||
if FCurrHoliday <> '' then
|
if FCurrHoliday <> '' then
|
||||||
RenderCanvas.Font.Assign(FMonthView.HolidayAttributes.Font);
|
RenderCanvas.Font.Assign(FMonthView.HolidayAttributes.Font);
|
||||||
|
|
||||||
|
FontStyle := RenderCanvas.Font.Style;
|
||||||
|
RenderCanvas.Font.Style := [fsBold, fsItalic];
|
||||||
|
textAdjust := RenderCanvas.TextWidth(str);
|
||||||
|
textHeight := RenderCanvas.TextHeight(str);
|
||||||
|
RenderCanvas.Font.Style := FontStyle;
|
||||||
|
|
||||||
{ Calculate size of rect for the day number at the top of the TextRect. }
|
{ Calculate size of rect for the day number at the top of the TextRect. }
|
||||||
if ACol = 6 then
|
if ACol = 6 then
|
||||||
tmpRect.Left := ATextRect.Left + mvColWidth - TextAdjust - FMonthView.DaysMargin
|
tmpRect.Left := ATextRect.Left + mvColWidth - TextAdjust - FMonthView.DaysMargin
|
||||||
else
|
else
|
||||||
tmpRect.Left := ATextRect.Right - TextAdjust - FMonthView.DaysMargin + 2;
|
tmpRect.Left := ATextRect.Right - TextAdjust - FMonthView.DaysMargin;
|
||||||
if fsItalic in RenderCanvas.Font.Style then
|
if fsItalic in RenderCanvas.Font.Style then
|
||||||
dec(tmpRect.Left, 2);
|
dec(tmpRect.Left, 2);
|
||||||
tmpRect.Top := ATextRect.Top + FMonthView.DaysMargin div 2;
|
tmpRect.Top := ATextRect.Top + FMonthView.DaysMargin;
|
||||||
tmpRect.Right := tmpRect.Left + textAdjust;
|
tmpRect.Right := tmpRect.Left + textAdjust;
|
||||||
tmpRect.Bottom := tmpRect.Top + textHeight;
|
tmpRect.Bottom := tmpRect.Top + textHeight;
|
||||||
|
|
||||||
@ -233,6 +233,7 @@ begin
|
|||||||
mvMonthDayArray[AIndex].Date := ADate;
|
mvMonthDayArray[AIndex].Date := ADate;
|
||||||
mvMonthDayArray[AIndex].OffDay := DisplayMonth <> M;
|
mvMonthDayArray[AIndex].OffDay := DisplayMonth <> M;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Inc(ADayNumber);
|
Inc(ADayNumber);
|
||||||
Inc(AIndex);
|
Inc(AIndex);
|
||||||
|
|
||||||
@ -510,7 +511,7 @@ begin
|
|||||||
TextRect.TopLeft := Point(dayRect.Left+1, dayRect.Top+1);
|
TextRect.TopLeft := Point(dayRect.Left+1, dayRect.Top+1);
|
||||||
TextRect.BottomRight := Point(
|
TextRect.BottomRight := Point(
|
||||||
TextRect.Left + mvColWidth,
|
TextRect.Left + mvColWidth,
|
||||||
TextRect.Top + mvEventTextHeight + txtMargin// div 2
|
TextRect.Top + mvEventTextHeight + txtMargin
|
||||||
);
|
);
|
||||||
|
|
||||||
{ set canvas color }
|
{ set canvas color }
|
||||||
@ -533,7 +534,7 @@ begin
|
|||||||
|
|
||||||
{ shorten events that are next to the day number, in order }
|
{ shorten events that are next to the day number, in order }
|
||||||
{ to give the day number enough room }
|
{ to give the day number enough room }
|
||||||
if (TextRect.Top < dayRect.Top + mvDayNumberHeight + txtMargin div 2)
|
if (TextRect.Top < dayRect.Top + mvDayNumberHeight + txtMargin)
|
||||||
then
|
then
|
||||||
TextRect.Right := TextRect.Left + mvColWidth - mvDayNumberHeight - txtMargin * 2
|
TextRect.Right := TextRect.Left + mvColWidth - mvDayNumberHeight - txtMargin * 2
|
||||||
else
|
else
|
||||||
|
@ -586,7 +586,7 @@ end;
|
|||||||
procedure TVpWeekViewPainter.DrawHeader;
|
procedure TVpWeekViewPainter.DrawHeader;
|
||||||
var
|
var
|
||||||
headRect, R: TRect;
|
headRect, R: TRect;
|
||||||
headTextRect: TRect;
|
// headTextRect: TRect;
|
||||||
headStr: string = '';
|
headStr: string = '';
|
||||||
headStrLen: Integer;
|
headStrLen: Integer;
|
||||||
maxStrLen: Integer;
|
maxStrLen: Integer;
|
||||||
|
Reference in New Issue
Block a user