tvplanit: Some more code for integration of TVpGanttView in tvplanit's printing eco-system.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8454 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-09-07 15:43:18 +00:00
parent 39d169dea7
commit 803fc6ce41

View File

@ -68,7 +68,7 @@
3) Modify RenderItem inside of TVpPrinter.PaintToCanvasRect to 3) Modify RenderItem inside of TVpPrinter.PaintToCanvasRect to
set the LinkableControl to the cached component for the appropriate set the LinkableControl to the cached component for the appropriate
value of the TVpItemType enumeration. value of the TVpItemType enumeration.
4) If the component is date base (calendar, dayview, weekview and the 4) If the component is date-based (calendar, dayview, weekview and the
like), set HaveDate to true at the end of RenderItem in like), set HaveDate to true at the end of RenderItem in
TVpPrinter.PaintToCanvasRect. Other changes may be required in TVpPrinter.PaintToCanvasRect. Other changes may be required in
RenderItem. RenderItem.
@ -426,6 +426,7 @@ type
property CurFormat: Integer read FCurFormat write SetCurFormat; property CurFormat: Integer read FCurFormat write SetCurFormat;
property DayView: TComponent read FDayView write FDayView; property DayView: TComponent read FDayView write FDayView;
property DefaultXMLFileName: string read FDefaultXMLFileName write SetDefaultXMLFileName; property DefaultXMLFileName: string read FDefaultXMLFileName write SetDefaultXMLFileName;
property GanttView: TComponent read FGanttView write FGanttView;
property HaveDate: Boolean read FHaveDate; property HaveDate: Boolean read FHaveDate;
property HaveTaskList: Boolean read FHaveTaskList; property HaveTaskList: Boolean read FHaveTaskList;
property LastTask: Integer read FLastTask; property LastTask: Integer read FLastTask;
@ -434,7 +435,6 @@ type
property MonthView: TComponent read FMonthView write FMonthView; property MonthView: TComponent read FMonthView write FMonthView;
property Printing: Boolean read FPrintJob; property Printing: Boolean read FPrintJob;
property TaskList: TComponent read FTaskList write FTaskList; property TaskList: TComponent read FTaskList write FTaskList;
property GanttView: TComponent read FGanttView write FGanttView;
property UseFormComponents: Boolean read FUseFormComponents write SetUseFormComponents default True; property UseFormComponents: Boolean read FUseFormComponents write SetUseFormComponents default True;
property WeekView: TComponent read FWeekView write FWeekView; property WeekView: TComponent read FWeekView write FWeekView;
@ -1375,6 +1375,7 @@ begin
FCalendar := TVpCalendar.CreateParented(FParentHandle); FCalendar := TVpCalendar.CreateParented(FParentHandle);
FContactGrid := TVpContactGrid.CreateParented(FParentHandle); FContactGrid := TVpContactGrid.CreateParented(FParentHandle);
FTaskList := TVpTaskList.CreateParented(FParentHandle); FTaskList := TVpTaskList.CreateParented(FParentHandle);
FGanttView := TVpGanttView.CreateParented(FParentHandle);
{$ELSE} {$ELSE}
FParent := TForm.Create(nil); FParent := TForm.Create(nil);
FDayView := TVpDayView.Create(FParent); FDayView := TVpDayView.Create(FParent);
@ -1405,6 +1406,7 @@ begin
FCalendar.Free; FCalendar.Free;
FContactGrid.Free; FContactGrid.Free;
FTaskList.Free; FTaskList.Free;
FGanttView.Free;
{$ELSE} {$ELSE}
FDayView.Free; FDayView.Free;
FWeekView.Free; FWeekView.Free;
@ -1712,7 +1714,8 @@ var
itDayView, itDayView,
itMonthView, itMonthView,
itWeekView, itWeekView,
itCalendar: FHaveDate := True; itCalendar,
itGanttView: FHaveDate := True;
end; end;
end; end;
@ -2230,6 +2233,7 @@ begin
itDayView : Writeln(fpOut, ' Item="DayView"'); itDayView : Writeln(fpOut, ' Item="DayView"');
itWeekView : Writeln(fpOut, ' Item="WeekView"'); itWeekView : Writeln(fpOut, ' Item="WeekView"');
itMonthView : Writeln(fpOut, ' Item="MonthView"'); itMonthView : Writeln(fpOut, ' Item="MonthView"');
itGanttView : WriteLn(fpOut, ' Item="GanttView"');
itCalendar : Writeln(fpOut, ' Item="Calendar"'); itCalendar : Writeln(fpOut, ' Item="Calendar"');
itShape : Writeln(fpOut, ' Item="Shape"'); itShape : Writeln(fpOut, ' Item="Shape"');
itCaption : Writeln(fpOut, ' Item="Caption"'); itCaption : Writeln(fpOut, ' Item="Caption"');
@ -2624,6 +2628,9 @@ begin
if attr.Value = 'MonthView' then if attr.Value = 'MonthView' then
NewElement.ItemType := itMonthView NewElement.ItemType := itMonthView
else else
if attr.Value = 'GanttView' then
NewElement.ItemType := itGanttView
else
if attr.Value = 'Shape' then if attr.Value = 'Shape' then
NewElement.ItemType := itShape NewElement.ItemType := itShape
else else