You've already forked lazarus-ccr
tvplanit: Add new property OffDayFontColor to MonthView. Use day names in MonthView from FormatSettings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4700 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -87,6 +87,7 @@ type
|
|||||||
FVisibleLines : Integer;
|
FVisibleLines : Integer;
|
||||||
FDayNameStyle : TVpMVDayNameStyle;
|
FDayNameStyle : TVpMVDayNameStyle;
|
||||||
FOffDayColor : TColor;
|
FOffDayColor : TColor;
|
||||||
|
FOffDayFontColor : TColor;
|
||||||
FSelectedDayColor : TColor;
|
FSelectedDayColor : TColor;
|
||||||
FWeekStartsOn : TVpDayType;
|
FWeekStartsOn : TVpDayType;
|
||||||
FShowEvents : Boolean;
|
FShowEvents : Boolean;
|
||||||
@ -132,6 +133,7 @@ type
|
|||||||
procedure SetColor(Value: TColor);
|
procedure SetColor(Value: TColor);
|
||||||
procedure SetLineColor(Value: TColor);
|
procedure SetLineColor(Value: TColor);
|
||||||
procedure SetOffDayColor(Value: TColor);
|
procedure SetOffDayColor(Value: TColor);
|
||||||
|
procedure SetOffDayFontColor(Value: TColor);
|
||||||
procedure SetDateLabelFormat(Value: string);
|
procedure SetDateLabelFormat(Value: string);
|
||||||
procedure SetShowEvents(Value: Boolean);
|
procedure SetShowEvents(Value: Boolean);
|
||||||
procedure SetEventDayStyle(Value: TFontStyles);
|
procedure SetEventDayStyle(Value: TFontStyles);
|
||||||
@ -241,6 +243,8 @@ type
|
|||||||
read FTimeFormat write SetTimeFormat;
|
read FTimeFormat write SetTimeFormat;
|
||||||
property OffDayColor: TColor
|
property OffDayColor: TColor
|
||||||
read FOffDayColor write SetOffDayColor;
|
read FOffDayColor write SetOffDayColor;
|
||||||
|
property OffDayFontColor: TColor
|
||||||
|
read FOffDayFontColor write SetOffDayFontColor default clGray;
|
||||||
property OwnerDrawCells: TVpOwnerDrawDayEvent
|
property OwnerDrawCells: TVpOwnerDrawDayEvent
|
||||||
read FOwnerDrawCells write FOwnerDrawCells;
|
read FOwnerDrawCells write FOwnerDrawCells;
|
||||||
property RightClickChangeDate : Boolean
|
property RightClickChangeDate : Boolean
|
||||||
@ -357,6 +361,7 @@ begin
|
|||||||
FEventFont := TFont.Create;
|
FEventFont := TFont.Create;
|
||||||
FEventFont.Assign(Font);
|
FEventFont.Assign(Font);
|
||||||
FEventFont.OnChange := mvFontChanged;
|
FEventFont.OnChange := mvFontChanged;
|
||||||
|
FOffDayFontColor := clGray;
|
||||||
|
|
||||||
SetLength(mvEventArray, MaxVisibleEvents);
|
SetLength(mvEventArray, MaxVisibleEvents);
|
||||||
SetLength(mvMonthdayArray, 45);
|
SetLength(mvMonthdayArray, 45);
|
||||||
@ -670,6 +675,9 @@ var
|
|||||||
|
|
||||||
if FDayNameStyle = dsLong then
|
if FDayNameStyle = dsLong then
|
||||||
{ Draw each day's full caption... }
|
{ Draw each day's full caption... }
|
||||||
|
{$IFDEF LCL}
|
||||||
|
str := FormatSettings.LongDayNames[DayTag+1]
|
||||||
|
{$ELSE}
|
||||||
case DayTag of
|
case DayTag of
|
||||||
0: str := RSSunday;
|
0: str := RSSunday;
|
||||||
1: str := RSMonday;
|
1: str := RSMonday;
|
||||||
@ -679,8 +687,12 @@ var
|
|||||||
5: str := RSFriday;
|
5: str := RSFriday;
|
||||||
6: str := RSSaturday;
|
6: str := RSSaturday;
|
||||||
end
|
end
|
||||||
|
{$ENDIF }
|
||||||
else if FDayNameStyle = dsShort then
|
else if FDayNameStyle = dsShort then
|
||||||
{ Draw each day's abbreviated caption... }
|
{ Draw each day's abbreviated caption... }
|
||||||
|
{$IFDEF LCL}
|
||||||
|
str := FormatSettings.ShortDayNames[DayTag+1]
|
||||||
|
{$ELSE}
|
||||||
case DayTag of
|
case DayTag of
|
||||||
0: str := RSASunday;
|
0: str := RSASunday;
|
||||||
1: str := RSAMonday;
|
1: str := RSAMonday;
|
||||||
@ -690,8 +702,12 @@ var
|
|||||||
5: str := RSAFriday;
|
5: str := RSAFriday;
|
||||||
6: str := RSASaturday;
|
6: str := RSASaturday;
|
||||||
end
|
end
|
||||||
|
{$ENDIF}
|
||||||
else if FDayNameStyle = dsLetter then
|
else if FDayNameStyle = dsLetter then
|
||||||
{ Draw each day's first letter only }
|
{ Draw each day's first letter only }
|
||||||
|
{$IFDEF LCL}
|
||||||
|
str := FormatSettings.ShortDayNames[DayTag+1, 1];
|
||||||
|
{$ELSE}
|
||||||
case DayTag of
|
case DayTag of
|
||||||
0: str := RSLSunday;
|
0: str := RSLSunday;
|
||||||
1: str := RSLMonday;
|
1: str := RSLMonday;
|
||||||
@ -701,6 +717,7 @@ var
|
|||||||
5: str := RSLFriday;
|
5: str := RSLFriday;
|
||||||
6: str := RSLSaturday;
|
6: str := RSLSaturday;
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{ Fix Header String }
|
{ Fix Header String }
|
||||||
StrL := RenderCanvas.TextWidth(Str);
|
StrL := RenderCanvas.TextWidth(Str);
|
||||||
@ -863,6 +880,8 @@ var
|
|||||||
RenderCanvas.Font.Style := [fsBold, fsItalic];
|
RenderCanvas.Font.Style := [fsBold, fsItalic];
|
||||||
TextAdjust := RenderCanvas.TextWidth (Str);
|
TextAdjust := RenderCanvas.TextWidth (Str);
|
||||||
RenderCanvas.Font.Style := FontStyle;
|
RenderCanvas.Font.Style := FontStyle;
|
||||||
|
if Tmp <> M then
|
||||||
|
RenderCanvas.Font.Color := FOffDayFontColor;
|
||||||
|
|
||||||
{ write the day number at the top of the square. }
|
{ write the day number at the top of the square. }
|
||||||
if fsItalic in RenderCanvas.Font.Style then
|
if fsItalic in RenderCanvas.Font.Style then
|
||||||
@ -970,6 +989,8 @@ var
|
|||||||
RenderCanvas.Font.Style := [fsBold, fsItalic];
|
RenderCanvas.Font.Style := [fsBold, fsItalic];
|
||||||
TextAdjust := RenderCanvas.TextWidth (Str);
|
TextAdjust := RenderCanvas.TextWidth (Str);
|
||||||
RenderCanvas.Font.Style := FontStyle;
|
RenderCanvas.Font.Style := FontStyle;
|
||||||
|
if Tmp <> M then
|
||||||
|
RenderCanvas.Font.Color := FOffdayFontColor;
|
||||||
|
|
||||||
if fsItalic in RenderCanvas.Font.Style then
|
if fsItalic in RenderCanvas.Font.Style then
|
||||||
TPSTextOut (RenderCanvas, Angle, RenderIn,
|
TPSTextOut (RenderCanvas, Angle, RenderIn,
|
||||||
@ -1082,6 +1103,8 @@ var
|
|||||||
|
|
||||||
{ set the event font }
|
{ set the event font }
|
||||||
RenderCanvas.Font.Assign(FEventFont);
|
RenderCanvas.Font.Assign(FEventFont);
|
||||||
|
if mvMonthDayArray[I].OffDay then
|
||||||
|
RenderCanvas.Font.Color := FOffDayFontColor;
|
||||||
|
|
||||||
StrLn := RenderCanvas.TextWidth(Str);
|
StrLn := RenderCanvas.TextWidth(Str);
|
||||||
if (StrLn > TextRect.Right - TextRect.Left - (TextMargin * 2)) then
|
if (StrLn > TextRect.Right - TextRect.Left - (TextMargin * 2)) then
|
||||||
@ -1288,6 +1311,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
|
procedure TVpMonthView.SetOffDayFontColor(Value: TColor);
|
||||||
|
begin
|
||||||
|
FOffDayFontColor := Value;
|
||||||
|
Invalidate;
|
||||||
|
end;
|
||||||
|
{=====}
|
||||||
|
|
||||||
procedure TVpMonthView.SetDateLabelFormat(Value: string);
|
procedure TVpMonthView.SetDateLabelFormat(Value: string);
|
||||||
begin
|
begin
|
||||||
if Value <> FDateLabelFormat then begin
|
if Value <> FDateLabelFormat then begin
|
||||||
|
Reference in New Issue
Block a user