You've already forked lazarus-ccr
tvplanit: Fix minor drawing glitch in WeekView. Some refactoring.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4886 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -34,6 +34,7 @@ type
|
|||||||
SaveBrushColor: TColor;
|
SaveBrushColor: TColor;
|
||||||
SavePenStyle: TPenStyle;
|
SavePenStyle: TPenStyle;
|
||||||
SavePenColor: TColor;
|
SavePenColor: TColor;
|
||||||
|
procedure DrawDotDotDot(ARect: TRect; AColor: TColor);
|
||||||
procedure InitPenBrush; virtual;
|
procedure InitPenBrush; virtual;
|
||||||
procedure SavePenBrush; virtual;
|
procedure SavePenBrush; virtual;
|
||||||
procedure RestorePenBrush; virtual;
|
procedure RestorePenBrush; virtual;
|
||||||
@@ -57,6 +58,21 @@ begin
|
|||||||
RenderCanvas := ARenderCanvas;
|
RenderCanvas := ARenderCanvas;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TVpBasePainter.DrawDotDotDot(ARect: TRect; AColor: TColor);
|
||||||
|
var
|
||||||
|
R: TRect;
|
||||||
|
begin
|
||||||
|
RenderCanvas.Brush.Color := AColor;
|
||||||
|
{ draw dot dot dot }
|
||||||
|
R := Rect(ARect.Right, ARect.Bottom, ARect.Right + 3, ARect.Bottom + 3);
|
||||||
|
OffsetRect(R, -20, -7);
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, R);
|
||||||
|
OffsetRect(R, 7, 0);
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, R);
|
||||||
|
OffsetRect(R, 7, 0);
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, R);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpBasePainter.InitPenBrush;
|
procedure TVpBasePainter.InitPenBrush;
|
||||||
begin
|
begin
|
||||||
RenderCanvas.Pen.Style := psSolid;
|
RenderCanvas.Pen.Style := psSolid;
|
||||||
|
@@ -35,6 +35,7 @@ type
|
|||||||
procedure Clear;
|
procedure Clear;
|
||||||
function DrawAllDayEvents(ADate: TDateTime; DayRect: TRect; var EAIndex: Integer): Boolean;
|
function DrawAllDayEvents(ADate: TDateTime; DayRect: TRect; var EAIndex: Integer): Boolean;
|
||||||
procedure DrawBorders;
|
procedure DrawBorders;
|
||||||
|
procedure DrawDotDotDot(ARect: TRect; AColor: TColor);
|
||||||
procedure DrawFocusRect(ADayIndex: Integer; DayRect: TRect);
|
procedure DrawFocusRect(ADayIndex: Integer; DayRect: TRect);
|
||||||
procedure DrawDay(ADayIndex: Integer; var DayRect: TRect; var EAIndex: Integer);
|
procedure DrawDay(ADayIndex: Integer; var DayRect: TRect; var EAIndex: Integer);
|
||||||
procedure DrawDayHeader(ADayIndex: Integer; var TextRect: TRect);
|
procedure DrawDayHeader(ADayIndex: Integer; var TextRect: TRect);
|
||||||
@@ -276,14 +277,18 @@ begin
|
|||||||
rowHeight := TVpWeekViewOpener(FWeekView).wvRowHeight;
|
rowHeight := TVpWeekViewOpener(FWeekView).wvRowHeight;
|
||||||
headerHeight := TVpWeekViewOpener(FWeekView).wvHeaderHeight;
|
headerHeight := TVpWeekViewOpener(FWeekView).wvHeaderHeight;
|
||||||
|
|
||||||
{ draw day head}
|
// Get header rectangle
|
||||||
RenderCanvas.Font.Assign(FWeekView.DayHeadAttributes.Font);
|
|
||||||
RenderCanvas.Brush.Color := RealDayHeadAttrColor;
|
|
||||||
TextRect := DayRect;
|
TextRect := DayRect;
|
||||||
TextRect.Bottom := DayRect.Top + dayHeadHeight;
|
TextRect.Bottom := DayRect.Top + dayHeadHeight;
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, TextRect);
|
|
||||||
|
{ draw day header }
|
||||||
|
tmpRect := TextRect;
|
||||||
|
inc(tmpRect.Right);
|
||||||
|
RenderCanvas.Font.Assign(FWeekView.DayHeadAttributes.Font);
|
||||||
|
RenderCanvas.Brush.Color := RealDayHeadAttrColor;
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
||||||
if FWeekView.DayHeadAttributes.Bordered then
|
if FWeekView.DayHeadAttributes.Bordered then
|
||||||
TPSRectangle(RenderCanvas, Angle, RenderIn, TextRect);
|
TPSRectangle(RenderCanvas, Angle, RenderIn, tmpRect);
|
||||||
|
|
||||||
{ Fix Header String }
|
{ Fix Header String }
|
||||||
DrawDayHeader(ADayIndex, TextRect);
|
DrawDayHeader(ADayIndex, TextRect);
|
||||||
@@ -327,15 +332,8 @@ begin
|
|||||||
{ dot dot dot to indicate there are more events than can be drawn }
|
{ dot dot dot to indicate there are more events than can be drawn }
|
||||||
{ in the available space }
|
{ in the available space }
|
||||||
if TextRect.Bottom - TextMargin > DayRect.Bottom then begin
|
if TextRect.Bottom - TextMargin > DayRect.Bottom then begin
|
||||||
RenderCanvas.Brush.Color := DotDotDotColor;
|
{ Draw ". . ." }
|
||||||
{ draw dot dot dot }
|
DrawDotDotDot(RenderCanvas, DayRect, DotDotDotColor);
|
||||||
tmpRect := Rect(DayRect.Right, DayRect.Bottom, DayRect.Right + 3, DayRect.Bottom + 3);
|
|
||||||
OffsetRect(tmpRect, -20, -7);
|
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
|
||||||
OffsetRect(tmpRect, 7, 0);
|
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
|
||||||
OffsetRect(tmpRect, 7, 0);
|
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user