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

@ -147,7 +147,7 @@ msgstr "Turbo Power VisualPlanIt Demo"
#: tmainform.cballowinplaceediting.caption
msgid "Allow inplace editing"
msgstr ""
msgstr "Editieren an Ort und Stelle erlauben"
#: tmainform.cbgranularity.text
msgid "30 Min"
@ -241,4 +241,3 @@ msgstr "Aufgaben"
#: tmainform.titlelbl.caption
msgid "TitleLbl"
msgstr ""

View File

@ -32,7 +32,7 @@ Portions created by TurboPower Software Inc. are Copyright (C) 2002 TurboPower S
Contributor(s): "/>
<Version Major="1" Release="4"/>
<Files Count="69">
<Files Count="70">
<Item1>
<Filename Value="../source/vpalarmdlg.lfm"/>
<Type Value="LFM"/>
@ -310,6 +310,10 @@ Contributor(s): "/>
<Filename Value="../source/vpcontactgridpainter.pas"/>
<UnitName Value="VpContactGridPainter"/>
</Item69>
<Item70>
<Filename Value="../source/vptasklistpainter.pas"/>
<UnitName Value="VpTasklistPainter"/>
</Item70>
</Files>
<i18n>
<EnableI18N Value="True"/>

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;