You've already forked lazarus-ccr
Some drawing corrections
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@753 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -83,7 +83,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
LMessages,LCLProc,LCLType,LCLIntf,
|
LMessages,LCLProc,LCLType,LCLIntf,FileUtil,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Windows,
|
Windows,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@ -34,7 +34,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
LMessages,LCLProc,LCLType,LCLIntf,
|
LMessages,LCLProc,LCLType,LCLIntf,FileUtil,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Windows,Messages,
|
Windows,Messages,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -570,10 +570,16 @@ var
|
|||||||
DrawBevelRect (RenderCanvas,
|
DrawBevelRect (RenderCanvas,
|
||||||
TPSRotateRectangle (Angle, RenderIn, HeadRect),
|
TPSRotateRectangle (Angle, RenderIn, HeadRect),
|
||||||
BevelHighlight, BevelDarkShadow);
|
BevelHighlight, BevelDarkShadow);
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
HeadRect.Left := RealLeft + 1;
|
||||||
|
HeadRect.Top := RealTop + 1;
|
||||||
|
HeadRect.Right := RealRight - 1;
|
||||||
|
HeadRect.Bottom := RealTop + mvDayHeadHeight;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Acquire startdate and end date }
|
{ Acquire startdate and end date }
|
||||||
HeadStr := FormatDateTime(DateLabelFormat, DisplayDate);
|
HeadStr := SysToUTF8(FormatDateTime(DateLabelFormat, DisplayDate));
|
||||||
|
|
||||||
{ draw the text }
|
{ draw the text }
|
||||||
if (DisplayOnly) and
|
if (DisplayOnly) and
|
||||||
|
@ -48,7 +48,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
LMessages,LCLProc,LCLType,LCLIntf,
|
LMessages,LCLProc,LCLType,LCLIntf,FileUtil,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Windows,Messages,
|
Windows,Messages,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -818,7 +818,7 @@ var
|
|||||||
if FDayHeadAttributes.Bordered then
|
if FDayHeadAttributes.Bordered then
|
||||||
TPSRectangle (RenderCanvas, Angle, RenderIn, TextRect);
|
TPSRectangle (RenderCanvas, Angle, RenderIn, TextRect);
|
||||||
{ Fix Header String }
|
{ Fix Header String }
|
||||||
DayStr := FormatDateTime(FDayHeadAttributes.DateFormat, StartDate + I);
|
DayStr := SysToUTF8(FormatDateTime(FDayHeadAttributes.DateFormat, StartDate + I));
|
||||||
SL := RenderCanvas.TextWidth(DayStr);
|
SL := RenderCanvas.TextWidth(DayStr);
|
||||||
if SL > TextRect.Right - TextRect.Left then begin
|
if SL > TextRect.Right - TextRect.Left then begin
|
||||||
DayStr := GetDisplayString(RenderCanvas, DayStr, 0, TextRect.Right -
|
DayStr := GetDisplayString(RenderCanvas, DayStr, 0, TextRect.Right -
|
||||||
@ -1025,6 +1025,15 @@ var
|
|||||||
HeadTextRect: TRect;
|
HeadTextRect: TRect;
|
||||||
HeadStr: string;
|
HeadStr: string;
|
||||||
HeadStrLen : Integer;
|
HeadStrLen : Integer;
|
||||||
|
function GetWeekOfYear(Datum:TDateTime):byte;
|
||||||
|
var
|
||||||
|
AYear,dummy :word;
|
||||||
|
First :TDateTime;
|
||||||
|
begin
|
||||||
|
DecodeDate(Datum+((8-DayOfWeek(Datum)) mod 7)-3, AYear, dummy,dummy);
|
||||||
|
First :=EncodeDate(AYear, 1, 1);
|
||||||
|
Result:=(trunc(Datum-First-3+(DayOfWeek(First)+1) mod 7) div 7)+1;
|
||||||
|
end;
|
||||||
begin
|
begin
|
||||||
RenderCanvas.Brush.Color := RealHeadAttrColor;
|
RenderCanvas.Brush.Color := RealHeadAttrColor;
|
||||||
RenderCanvas.Font.Assign(TFont(FHeadAttr.Font));
|
RenderCanvas.Font.Assign(TFont(FHeadAttr.Font));
|
||||||
@ -1049,10 +1058,16 @@ var
|
|||||||
DrawBevelRect (RenderCanvas,
|
DrawBevelRect (RenderCanvas,
|
||||||
TPSRotateRectangle (Angle, RenderIn, HeadRect),
|
TPSRotateRectangle (Angle, RenderIn, HeadRect),
|
||||||
BevelHighlightColor, BevelDarkShadow);
|
BevelHighlightColor, BevelDarkShadow);
|
||||||
|
end else begin
|
||||||
|
HeadRect.Left := RealLeft + 1;
|
||||||
|
HeadRect.Top := RealTop + 1;
|
||||||
|
HeadRect.Right := RealRight - 1;
|
||||||
|
HeadRect.Bottom := HeadRect.Top + wvHeaderHeight;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ build header caption }
|
{ build header caption }
|
||||||
HeadStr := HeadStr + RSWeekof + ' '
|
HeadStr := HeadStr + RSWeekof + ' '
|
||||||
+ FormatDateTime(DateLabelFormat, StartDate);
|
+ FormatDateTime(DateLabelFormat, StartDate)+' (KW'+IntToStr(GetWeekOfYear(StartDate))+')';
|
||||||
{ draw the text }
|
{ draw the text }
|
||||||
if (DisplayOnly) and
|
if (DisplayOnly) and
|
||||||
(RenderCanvas.TextWidth (HeadStr) >= RenderIn.Right - RenderIn.Left) then
|
(RenderCanvas.TextWidth (HeadStr) >= RenderIn.Right - RenderIn.Left) then
|
||||||
|
Reference in New Issue
Block a user