tvplanit: Extract VpTaskList drawing code to separate unit VpTaskListPainter.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4816 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-24 09:22:38 +00:00
parent eec24fb3f0
commit 8516b2ee42
7 changed files with 28 additions and 18 deletions

View File

@@ -3,7 +3,7 @@ unit VpBasePainter;
interface
uses
Classes, Graphics,
Classes, Graphics, LCLType,
VPBase;
type
@@ -23,6 +23,8 @@ type
UseGran: TVpGranularity;
DisplayOnly: Boolean;
protected
// Shared local variables of all the old painting routines
Rgn: HRGN;
RealWidth: Integer;
RealHeight: Integer;
RealLeft: Integer;

View File

@@ -16,7 +16,6 @@ type
PhoneLblWidth: Integer;
StartContact: Integer;
RealColumnWidth: Integer;
Rgn: HRGN;
RealColor: TColor;
SizingBarColor: TColor;
BevelDarkShadow: TColor;

View File

@@ -38,7 +38,6 @@ type
EventCount: Integer;
DayWidth: Integer;
RealNumDays: Integer;
Rgn: HRGN;
RealRowHeight: Integer;
RealColHeadHeight: Integer;
RealRowHeadWidth: Integer;

View File

@@ -281,7 +281,7 @@ type
implementation
uses
SysUtils, Math, Forms, Dialogs, VpTaskEditDlg, VpDlg;
SysUtils, Math, Forms, Dialogs, VpTaskEditDlg, VpDlg, VpTasklistPainter;
(*****************************************************************************)
@@ -658,15 +658,23 @@ begin
end;
{=====}
procedure TVpTaskList.RenderToCanvas (RenderCanvas : TCanvas;
RenderIn : TRect;
Angle : TVpRotationAngle;
Scale : Extended;
RenderDate : TDateTime;
StartLine : Integer;
StopLine : Integer;
UseGran : TVpGranularity;
DisplayOnly : Boolean);
procedure TVpTaskList.RenderToCanvas(RenderCanvas: TCanvas; RenderIn: TRect;
Angle: TVpRotationAngle; Scale: Extended; RenderDate : TDateTime;
StartLine, StopLine: Integer; UseGran: TVpGranularity; DisplayOnly: Boolean);
var
painter: TVpTaskListPainter;
begin
tlPainting := true;
painter := TVpTaskListPainter.Create(Self, RenderCanvas);
try
painter.RenderToCanvas(RenderIn, Angle, Scale, RenderDate, StartLine,
StopLine, UseGran, DisplayOnly);
finally
painter.Free;
tlPainting := false;
end;
end;
(*
var
HeadRect : TRect;
Bmp : Graphics.TBitmap;
@@ -1179,7 +1187,7 @@ begin
RenderCanvas.Pen.Color := SavePenColor;
tlPainting := false;
end;
{=====}
{=====} *)
procedure TVpTaskList.SetColor(const Value: TColor);
begin

View File

@@ -21,7 +21,6 @@ type
StrLn: Integer;
StartDate: TDateTime;
ADEventsRect: TRect;
Rgn: HRGN;
DotDotDotColor: TColor;
BevelHighlightColor: TColor;
BevelShadowColor: TColor;