You've already forked lazarus-ccr
tvplanit: Fix incomplete painting of thick edit frame around focused event in DayView.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4827 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -79,6 +79,7 @@ type
|
|||||||
procedure DrawAllDays;
|
procedure DrawAllDays;
|
||||||
procedure DrawCells(R: TRect; ColDate: TDateTime; Col: Integer);
|
procedure DrawCells(R: TRect; ColDate: TDateTime; Col: Integer);
|
||||||
procedure DrawColHeader(R: TRect; ARenderDate: TDateTime; Col: Integer);
|
procedure DrawColHeader(R: TRect; ARenderDate: TDateTime; Col: Integer);
|
||||||
|
procedure DrawEditFrame(R: TRect; AGutter: Integer; AColor: TColor);
|
||||||
procedure DrawEvents(ARenderDate: TDateTime; Col: Integer);
|
procedure DrawEvents(ARenderDate: TDateTime; Col: Integer);
|
||||||
procedure DrawIcons(AIconRect: TRect);
|
procedure DrawIcons(AIconRect: TRect);
|
||||||
procedure DrawRowHeader(R: TRect);
|
procedure DrawRowHeader(R: TRect);
|
||||||
@ -680,6 +681,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ paint extra borders around the editor }
|
||||||
|
procedure TVpDayViewPainter.DrawEditFrame(R: TRect; AGutter: Integer;
|
||||||
|
AColor: TColor);
|
||||||
|
begin
|
||||||
|
RenderCanvas.Pen.Color := clWindowFrame;
|
||||||
|
RenderCanvas.Brush.Color := AColor;
|
||||||
|
with R do begin
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, Rect(Left, Top-AGutter, Right, Top));
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, Rect(Left-AGutter, Top, Left, Bottom));
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, Rect(Left, Bottom, Right, Bottom + AGutter));
|
||||||
|
TPSFillRect(RenderCanvas, Angle, RenderIn, Rect(Right, Top, Right+AGutter, Bottom));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpDayViewPainter.DrawEvents(ARenderDate: TDateTime; Col: Integer);
|
procedure TVpDayViewPainter.DrawEvents(ARenderDate: TDateTime; Col: Integer);
|
||||||
var
|
var
|
||||||
I,J, StartPixelOffset, EndPixelOffset: Integer;
|
I,J, StartPixelOffset, EndPixelOffset: Integer;
|
||||||
@ -1193,45 +1208,20 @@ begin
|
|||||||
Inc(EventCount);
|
Inc(EventCount);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ paint extra borders around the editor }
|
||||||
OKToDrawEditFrame := True;
|
OKToDrawEditFrame := True;
|
||||||
if Assigned(FDayView.ActiveEvent) then
|
if Assigned(FDayView.ActiveEvent) then
|
||||||
OKToDrawEditFrame := not (FDayView.ActiveEvent.AllDayEvent);
|
OKToDrawEditFrame := not (FDayView.ActiveEvent.AllDayEvent);
|
||||||
|
|
||||||
if (TVpDayViewOpener(FDayView).dvInPlaceEditor <> nil) and
|
if (TVpDayViewOpener(FDayView).dvInPlaceEditor <> nil) and
|
||||||
TVpDayViewOpener(FDayView).dvInplaceEditor.Visible and
|
TVpDayViewOpener(FDayView).dvInplaceEditor.Visible and
|
||||||
OKToDrawEditFrame then
|
OKToDrawEditFrame
|
||||||
begin
|
then
|
||||||
{ paint extra borders around the editor }
|
with TVpDayViewOpener(FDayView) do
|
||||||
if Assigned(FDayView.DataStore) then
|
DrawEditFrame(dvActiveEventRec, GutterWidth, Datastore.CategoryColorMap.GetColor(ActiveEvent.Category));
|
||||||
RenderCanvas.Brush.Color := FDayView.DataStore.CategoryColorMap.GetColor(FDayView.ActiveEvent.Category);
|
|
||||||
RenderCanvas.Pen.Color := clWindowFrame;
|
|
||||||
with TVpDayViewOpener(FDayView) do begin
|
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn,
|
|
||||||
Rect(dvActiveEventRec.Left, dvActiveEventRec.Top - GutterWidth, dvActiveEventRec.Right, dvActiveEventRec.Top)
|
|
||||||
);
|
|
||||||
TPSPolyline(RenderCanvas, Angle, RenderIn, [
|
|
||||||
Point(dvActiveEventRec.Left, dvActiveEventRec.Top),
|
|
||||||
Point(dvActiveEventRec.Left, dvActiveEventRec.Top - FDayView.GutterWidth),
|
|
||||||
Point(dvActiveEventRec.Right, dvActiveEventRec.Top - FDayView.GutterWidth),
|
|
||||||
Point(dvActiveEventRec.Right, dvActiveEventRec.Top)
|
|
||||||
]);
|
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, Rect(
|
|
||||||
dvActiveEventRec.Left,
|
|
||||||
dvActiveEventRec.Bottom,
|
|
||||||
dvActiveEventRec.Right,
|
|
||||||
dvActiveEventRec.Bottom + FDayView.GutterWidth
|
|
||||||
));
|
|
||||||
TPSPolyline(RenderCanvas, Angle, RenderIn, [
|
|
||||||
Point(dvActiveEventRec.Left, dvActiveEventRec.Bottom),
|
|
||||||
Point(dvActiveEventRec.Left, dvActiveEventRec.Bottom + FDayView.GutterWidth),
|
|
||||||
Point(dvActiveEventRec.Right, dvActiveEventRec.Bottom + FDayView.GutterWidth),
|
|
||||||
Point(dvActiveEventRec.Right, dvActiveEventRec.Bottom)
|
|
||||||
]);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ Clean Up }
|
|
||||||
finally
|
finally
|
||||||
|
{ Clean Up }
|
||||||
try
|
try
|
||||||
SetLength(EventArray, 0);
|
SetLength(EventArray, 0);
|
||||||
FreeBitmaps;
|
FreeBitmaps;
|
||||||
|
Reference in New Issue
Block a user