tvplanit: Add new parameter AGutterRect to the OnBeforeDrawEvent and OnAfterDrawEvent events of TVpDayView (issue #33748)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6425 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-05-17 07:58:22 +00:00
parent fd2a79771a
commit 2fd663bcf0
2 changed files with 9 additions and 5 deletions

View File

@ -96,10 +96,10 @@ type
TVpDVIcons = array [itAlarm..itCustom] of TVpDVIconData; TVpDVIcons = array [itAlarm..itCustom] of TVpDVIconData;
TVpOnDVBeforeDrawEvent = procedure (Sender: TObject; Event: TVpEvent; TVpOnDVBeforeDrawEvent = procedure (Sender: TObject; Event: TVpEvent;
Active: Boolean; ACanvas: TCanvas; EventRect: TRect; IconRect: TRect) of object; AActive: Boolean; ACanvas: TCanvas; AGutterRect, AEventRect, AIconRect: TRect) of object;
TVpOnDVAfterDrawEvent = procedure (Sender: TObject; Event: TVpEvent; TVpOnDVAfterDrawEvent = procedure (Sender: TObject; Event: TVpEvent;
Active: Boolean; ACanvas: TCanvas; EventRect: TRect; IconRect: TRect) of object; AActive: Boolean; ACanvas: TCanvas; AGutterRect, AEventRect, AIconRect: TRect) of object;
TVpOnDVDrawIcons = procedure (Sender: TObject; Event: TVpEvent; TVpOnDVDrawIcons = procedure (Sender: TObject; Event: TVpEvent;
var Icons: TVpDVIcons) of object; var Icons: TVpDVIcons) of object;

View File

@ -843,7 +843,8 @@ begin
tmpRect := EventRect; tmpRect := EventRect;
if (AEventRec.Level <> 0) then if (AEventRec.Level <> 0) then
inc(tmpRect.Left, FDayView.GutterWidth); inc(tmpRect.Left, FDayView.GutterWidth);
FDayView.OnBeforeDrawEvent(Self, AEvent, FDayView.ActiveEvent = AEvent, RenderCanvas, tmpRect, IconRect); FDayView.OnBeforeDrawEvent(Self, AEvent, FDayView.ActiveEvent = AEvent,
RenderCanvas, GutterRect, tmpRect, IconRect);
end; end;
if FDayView.IconAttributes.ShowInPrint then if FDayView.IconAttributes.ShowInPrint then
@ -882,7 +883,8 @@ begin
tmpRect := EventRect; tmpRect := EventRect;
if (AEventRec.Level <> 0) then if (AEventRec.Level <> 0) then
inc(tmpRect.Left, FDayView.GutterWidth); inc(tmpRect.Left, FDayView.GutterWidth);
FDayView.OnAfterDrawEvent(Self, AEvent, FDayView.ActiveEvent = AEvent, RenderCanvas, tmpRect, IconRect); FDayView.OnAfterDrawEvent(Self, AEvent, FDayView.ActiveEvent = AEvent,
RenderCanvas, GutterRect, tmpRect, IconRect);
end; end;
RenderCanvas.Brush.Assign(OldBrush); // wp: Original code had "Canvas" here which does not look correct. RenderCanvas.Brush.Assign(OldBrush); // wp: Original code had "Canvas" here which does not look correct.
@ -1910,7 +1912,9 @@ begin
{ added because level 0 events were one pixel too far to the right } { added because level 0 events were one pixel too far to the right }
else else
AEventRect.Left := AEventRect.Left - 1; AEventRect.Left := AEventRect.Left - 1;
AEventRect.Right := AEventRect.Left + eventWidth + 1; AEventRect.Right := AEventRect.Left + eventWidth;; // + 1; -- wp: removed to avoid painting over the right border line
dec(AEventRect.Top); // wp: without this, the top border line of the event is thicker than the others
end; end;
{ remove the date portion from the start and end times } { remove the date portion from the start and end times }