tvplanit: Add simple printing test projects

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8545 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-10-12 20:24:11 +00:00
parent 3cb293895d
commit 6242422cf8
34 changed files with 3166 additions and 0 deletions

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="calPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="calPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="calmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="calMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="calPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program calPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, calMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,229 @@
object Form1: TForm1
Left = 327
Height = 347
Top = 127
Width = 420
Caption = 'Form1'
ClientHeight = 347
ClientWidth = 420
OnCreate = FormCreate
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 408
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 408
TabOrder = 0
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
end
object VpCalendar1: TVpCalendar
Left = 0
Height = 309
Top = 38
Width = 420
PopupMenu = VpCalendar1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Font.Height = -12
ParentFont = False
Align = alClient
Colors.ActiveDay = clBlue
Colors.ActiveDayBorder = clBlack
Colors.ActiveDayText = clWhite
Colors.Background = clDefault
Colors.ColorScheme = cscalCustom
Colors.DayNames = clMaroon
Colors.Days = clBlack
Colors.InactiveDays = clMedGray
Colors.MonthAndYear = clBlue
Colors.Weekend = clRed
Colors.EventDays = clBlack
TabOrder = 1
TabStop = True
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'Calendar'
Height = 100
ItemType = itCalendar
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Calendar Portrait'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'Calendar'
Height = 100
ItemType = itCalendar
Left = 0
Rotation = ra90
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Calendar Landscape 90°'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'Calendar'
Height = 100
ItemType = itCalendar
Left = 0
Rotation = ra270
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Calendar Landscape 270°'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'Calendar'
Height = 100
ItemType = itCalendar
Left = 0
Rotation = ra180
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Calendar Portrait upside-down'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'data.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 304
Top = 99
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,88 @@
unit calMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
PrintersDlgs, VpBaseDS, VpIniDs, VpPrtPrvDlg, VpPrtFmtCBox,
VpData, VpMonthView, VpCalendar;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
VpCalendar1: TVpCalendar;
VpControlLink1: TVpControlLink;
VpIniDatastore1: TVpIniDatastore;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 12, 31);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 12, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
VpCalendar1.Date := EncodeDate(2022, 10, 1);
end;
end.

View File

@ -0,0 +1,21 @@
[General]
Version=v105
[Resources]
1178568021={Description:Test}|{ResourceActive:true}
[Events of resource 1178568021]
1273124118={StartTime:2022/10/01 10:00:00}|{EndTime:2022/10/01 12:30:00}|{ResourceID:1178568021}|{Description:Test event 1}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1535857465={StartTime:2022/10/02 13:00:00}|{EndTime:2022/10/02 16:00:00}|{ResourceID:1178568021}|{Description:Test event 2}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1842424188={StartTime:2022/10/02 18:00:00}|{EndTime:2022/10/02 19:00:00}|{ResourceID:1178568021}|{Description:Test event 2a}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1813046879={StartTime:2022/10/03 10:00:00}|{EndTime:2022/10/03 13:00:00}|{ResourceID:1178568021}|{Description:Test event 3}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1294424480={StartTime:2022/10/04 08:00:00}|{EndTime:2022/10/04 08:30:00}|{ResourceID:1178568021}|{Description:All-day event}|{Category:2}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1819459250={StartTime:2022/10/05 09:30:00}|{EndTime:2022/10/05 13:45:00}|{ResourceID:1178568021}|{Description:Test 4a}|{Category:4}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1170127712={StartTime:2022/10/05 10:30:00}|{EndTime:2022/10/05 19:00:00}|{ResourceID:1178568021}|{Description:Test 4}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
909791748={StartTime:2022/10/06 08:30:00}|{EndTime:2022/10/06 09:00:00}|{ResourceID:1178568021}|{Description:All-day}|{Category:3}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1387047049={StartTime:2022/10/07 09:00:00}|{EndTime:2022/10/07 13:00:00}|{ResourceID:1178568021}|{Description:Test 6}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
825453432={StartTime:2022/10/07 12:30:00}|{EndTime:2022/10/07 19:00:00}|{ResourceID:1178568021}|{Description:Test 6a}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
939711377={StartTime:2022/10/08 10:00:00}|{EndTime:2022/10/08 10:30:00}|{ResourceID:1178568021}|{Description:Test}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
638950699={StartTime:2022/10/31 15:00:00}|{EndTime:2022/10/31 18:00:00}|{ResourceID:1178568021}|{Description:Test Oct-31}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1339092840={StartTime:2022/11/06 10:00:00}|{EndTime:2022/11/06 15:00:00}|{ResourceID:1178568021}|{Description:Test Nov-10}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1915067938={StartTime:2022/11/30 12:00:00}|{EndTime:2022/11/30 14:00:00}|{ResourceID:1178568021}|{Description:Test Nov-30}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="cgPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="cgPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="cgmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="cgMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="cgPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program cgPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, cgMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,229 @@
object Form1: TForm1
Left = 327
Height = 523
Top = 127
Width = 636
Caption = 'Form1'
ClientHeight = 523
ClientWidth = 636
OnCreate = FormCreate
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 624
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 624
TabOrder = 0
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
end
object VpContactGrid1: TVpContactGrid
Left = 40
Height = 485
Top = 38
Width = 596
PopupMenu = VpContactGrid1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Font.Height = -12
ParentFont = False
Align = alClient
TabOrder = 1
ContactHeadAttributes.Font.Height = -12
end
object VpContactButtonBar1: TVpContactButtonBar
Left = 0
Height = 485
Top = 38
Width = 40
Align = alLeft
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'ContactGrid'
Height = 100
ItemType = itContacts
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Contacts Portrait'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'ContactGrid'
Height = 100
ItemType = itContacts
Left = 0
Rotation = ra90
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Contacts Landscape 90°'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'ContactGrid'
Height = 100
ItemType = itContacts
Left = 0
Rotation = ra270
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Contacts Landscape 270°'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'ContactGrid'
Height = 100
ItemType = itContacts
Left = 0
Rotation = ra180
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'Contacts Portrait Upside Down'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category0.UseForAllDayEvents = True
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category1.UseForAllDayEvents = True
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category2.UseForAllDayEvents = True
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category3.UseForAllDayEvents = True
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'data.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 304
Top = 99
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,88 @@
unit cgMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Spin, PrintersDlgs, VpBaseDS, VpIniDs, VpDayView, VpPrtPrvDlg, VpPrtFmtCBox,
VpContactGrid, VpContactButtons;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
VpContactButtonBar1: TVpContactButtonBar;
VpContactGrid1: TVpContactGrid;
VpControlLink1: TVpControlLink;
VpIniDatastore1: TVpIniDatastore;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
end;
end.

View File

@ -0,0 +1,29 @@
[General]
Version=v105
[Resources]
1178568021={Description:Test}|{ResourceActive:true}
[Contacts of resource 1178568021]
1={FirstName:FirstName01}|{LastName:Name01}|{BirthDate:9999/12/31}|{Company:Company01}|{EMail1:name01@work.com}|{Address1:WorkAddress01}|{City1:WorkCity01}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name01@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress01}|{City2:HomeCity01}|{AddressType2:1}
2={FirstName:FirstName02}|{LastName:Name02}|{BirthDate:9999/12/31}|{Company:Company02}|{EMail1:name02@work.com}|{Address1:WorkAddress02}|{City1:WorkCity02}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name02@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress02}|{City2:HomeCity02}|{AddressType2:1}
3={FirstName:FirstName03}|{LastName:Name03}|{BirthDate:9999/12/31}|{Company:Company03}|{EMail1:name03@work.com}|{Address1:WorkAddress03}|{City1:WorkCity03}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name03@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress03}|{City2:HomeCity03}|{AddressType2:1}
4={FirstName:FirstName04}|{LastName:Name04}|{BirthDate:9999/12/31}|{Company:Company04}|{EMail1:name04@work.com}|{Address1:WorkAddress04}|{City1:WorkCity04}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name04@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress04}|{City2:HomeCity04}|{AddressType2:1}
5={FirstName:FirstName05}|{LastName:Name05}|{BirthDate:9999/12/31}|{Company:Company05}|{EMail1:name05@work.com}|{Address1:WorkAddress05}|{State1:WorkCity05}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name05@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress05}|{City2:HomeCity05}|{AddressType2:1}
6={FirstName:FirstName06}|{LastName:Name06}|{BirthDate:9999/12/31}|{Company:Company06}|{EMail1:name06@work.com}|{Address1:WorkAddress06}|{City1:WorkCity06}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name06@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress06}|{City2:HomeCity06}|{AddressType2:1}
7={FirstName:FirstName07}|{LastName:Name07}|{BirthDate:9999/12/31}|{Company:Company07}|{EMail1:name07@work.com}|{Address1:WorkAddress07}|{City1:WorkCity07}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name07@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress07}|{City2:HomeCity07}|{AddressType2:1}
8={FirstName:FirstName08}|{LastName:Name08}|{BirthDate:9999/12/31}|{Company:Company08}|{EMail1:name08@work.com}|{Address1:WorkAddress08}|{City1:WorkCity08}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name08@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress08}|{City2:HomeCity08}|{AddressType2:1}
9={FirstName:FirstName09}|{LastName:Name09}|{BirthDate:9999/12/31}|{Company:Company09}|{EMail1:name09@work.com}|{Address1:WorkAddress09}|{City1:WorkCity09}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name09@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress09}|{City2:HomeCity09}|{AddressType2:1}
10={FirstName:FirstName10}|{LastName:Name10}|{BirthDate:9999/12/31}|{Company:Company10}|{EMail1:name10@work.com}|{Address1:WorkAddress10}|{City1:WorkCity10}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name10@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress10}|{City2:HomeCity10}|{AddressType2:1}
11={FirstName:FirstName11}|{LastName:Name11}|{BirthDate:9999/12/31}|{Company:Company11}|{EMail1:name11@work.com}|{Address1:WorkAddress11}|{City1:WorkCity11}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name11@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress11}|{City2:HomeCity11}|{AddressType2:1}
12={FirstName:FirstName12}|{LastName:Name12}|{BirthDate:9999/12/31}|{Company:Company12}|{EMail1:name12@work.com}|{Address1:WorkAddress12}|{State1:WorkCity12}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name12@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress12}|{City2:HomeCity12}|{AddressType2:1}
13={FirstName:FirstName13}|{LastName:Name13}|{BirthDate:9999/12/31}|{Company:Company13}|{EMail1:name13@work.com}|{Address1:WorkAddress13}|{City1:WorkCity13}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name13@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress13}|{City2:HomeCity13}|{AddressType2:1}
14={FirstName:FirstName14}|{LastName:Name14}|{BirthDate:9999/12/31}|{Company:Company14}|{EMail1:name14@work.com}|{Address1:WorkAddress14}|{City1:WorkCity14}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name14@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress14}|{City2:HomeCity14}|{AddressType2:1}
15={FirstName:FirstName15}|{LastName:Name15}|{BirthDate:9999/12/31}|{Company:Company15}|{EMail1:name15@work.com}|{Address1:WorkAddress15}|{City1:WorkCity15}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name15@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress15}|{City2:HomeCity15}|{AddressType2:1}
16={FirstName:FirstName16}|{LastName:Name16}|{BirthDate:9999/12/31}|{Company:Company16}|{EMail1:name16@work.com}|{Address1:WorkAddress16}|{City1:WorkCity16}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name16@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress16}|{City2:HomeCity16}|{AddressType2:1}
17={FirstName:FirstName17}|{LastName:Name17}|{BirthDate:9999/12/31}|{Company:Company17}|{EMail1:name17@work.com}|{Address1:WorkAddress17}|{City1:WorkCity17}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name17@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress17}|{City2:HomeCity17}|{AddressType2:1}
18={FirstName:FirstName18}|{LastName:Name18}|{BirthDate:9999/12/31}|{Company:Company18}|{EMail1:name18@work.com}|{Address1:WorkAddress18}|{City1:WorkCity18}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name18@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress18}|{City2:HomeCity18}|{AddressType2:1}
19={FirstName:FirstName19}|{LastName:Name19}|{BirthDate:9999/12/31}|{Company:Company19}|{EMail1:name19@work.com}|{Address1:WorkAddress19}|{City1:WorkCity19}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name19@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress19}|{City2:HomeCity19}|{AddressType2:1}
20={FirstName:FirstName20}|{LastName:Name20}|{BirthDate:9999/12/31}|{Company:Company20}|{EMail1:name20@work.com}|{Address1:WorkAddress20}|{City1:WorkCity20}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name20@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress20}|{City2:HomeCity20}|{AddressType2:1}
21={FirstName:FirstName21}|{LastName:Name21}|{BirthDate:9999/12/31}|{Company:Company21}|{EMail1:name21@work.com}|{Address1:WorkAddress21}|{City1:WorkCity21}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name21@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress21}|{City2:HomeCity21}|{AddressType2:1}
22={FirstName:FirstName22}|{LastName:Name22}|{BirthDate:9999/12/31}|{Company:Company22}|{EMail1:name22@work.com}|{Address1:WorkAddress22}|{City1:WorkCity22}|{Phone1:0123/4567890}|{PhoneType1:15}|{PhoneType2:4}|{PhoneType3:16}|{PhoneType4:7}|{PhoneType5:0}|{Category:0}|{EMailType1:0}|{EMail2:name22@home.com}|{EMailType2:1}|{EMailType3:2}|{WebsiteType1:0}|{WebsiteType2:1}|{AddressType1:0}|{Address2:HomeAddress22}|{City2:HomeCity22}|{AddressType2:1}

View File

@ -0,0 +1,19 @@
[General]
Version=v105
[Resources]
1178568021={Description:Test}|{ResourceActive:true}
[Events of resource 1178568021]
1273124118={StartTime:2022/10/01 10:00:00}|{EndTime:2022/10/01 12:30:00}|{ResourceID:1178568021}|{Description:Test event 1}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1535857465={StartTime:2022/10/02 13:00:00}|{EndTime:2022/10/02 16:00:00}|{ResourceID:1178568021}|{Description:Test event 2}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1842424188={StartTime:2022/10/02 18:00:00}|{EndTime:2022/10/02 19:00:00}|{ResourceID:1178568021}|{Description:Test event 2a}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1813046879={StartTime:2022/10/03 10:00:00}|{EndTime:2022/10/03 13:00:00}|{ResourceID:1178568021}|{Description:Test event 3}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1294424480={StartTime:2022/10/04 08:00:00}|{EndTime:2022/10/04 08:30:00}|{ResourceID:1178568021}|{Description:All-day event}|{Category:2}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1819459250={StartTime:2022/10/05 09:30:00}|{EndTime:2022/10/05 13:45:00}|{ResourceID:1178568021}|{Description:Test 4a}|{Category:4}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1170127712={StartTime:2022/10/05 10:30:00}|{EndTime:2022/10/05 19:00:00}|{ResourceID:1178568021}|{Description:Test 4}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
909791748={StartTime:2022/10/06 08:30:00}|{EndTime:2022/10/06 09:00:00}|{ResourceID:1178568021}|{Description:All-day}|{Category:3}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1339092840={StartTime:2022/10/06 10:30:00}|{EndTime:2022/10/06 14:00:00}|{ResourceID:1178568021}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1387047049={StartTime:2022/10/07 09:00:00}|{EndTime:2022/10/07 13:00:00}|{ResourceID:1178568021}|{Description:Test 6}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
825453432={StartTime:2022/10/07 12:30:00}|{EndTime:2022/10/07 19:00:00}|{ResourceID:1178568021}|{Description:Test 6a}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
939711377={StartTime:2022/10/08 10:00:00}|{EndTime:2022/10/08 10:30:00}|{ResourceID:1178568021}|{Description:Test}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="dvPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="dvPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="dvmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="dvMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="dvPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program dvPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, dvMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,225 @@
object Form1: TForm1
Left = 327
Height = 523
Top = 127
Width = 584
Caption = 'Form1'
ClientHeight = 523
ClientWidth = 584
OnCreate = FormCreate
object VpDayView1: TVpDayView
Left = 0
Height = 485
Top = 38
Width = 584
PopupMenu = VpDayView1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Font.Height = -12
ParentFont = False
Align = alClient
TabOrder = 0
AllDayEventAttributes.Font.Height = -12
TimeSlotColors.Active = clWhite
TimeSlotColors.ActiveRange.RangeBegin = h_00
TimeSlotColors.ActiveRange.RangeEnd = h_00
HeadAttributes.Font.Height = -13
RowHeadAttributes.HourFont.Height = -24
RowHeadAttributes.MinuteFont.Height = -12
end
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 572
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 572
TabOrder = 1
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
object SpinEdit1: TSpinEdit
AnchorSideLeft.Control = Label1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 453
Height = 23
Top = 2
Width = 51
Alignment = taRightJustify
BorderSpacing.Left = 4
MaxValue = 7
MinValue = 1
OnChange = SpinEdit1Change
TabOrder = 3
Value = 1
end
object Label1: TLabel
AnchorSideLeft.Control = btnPrint
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 424
Height = 15
Top = 6
Width = 25
BorderSpacing.Left = 24
Caption = 'Days'
end
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duDay
Description = 'DayView with 1 day'
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'DayView'
Height = 100
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'One day'
end
item
Version = 'v1.0.7'
DayInc = 2
DayIncUnits = duDay
Description = '2 Day views'
Elements = <
item
Version = 'v1.0.7'
DayOffset = 1
DayOffsetUnits = duDay
ElementName = 'Top DayView'
Height = 48
Left = 2
Rotation = ra270
Shape.Shape = ustRectangle
Top = 2
Width = 96
end
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'Bottom DayView'
Height = 48
Left = 2
Rotation = ra270
Shape.Shape = ustRectangle
Top = 51
Width = 98
end>
FormatName = 'Two days'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'file error.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 304
Top = 99
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,95 @@
unit dvMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Spin, PrintersDlgs, VpBaseDS, VpIniDs, VpDayView, VpPrtPrvDlg, VpPrtFmtCBox, VpData;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Label1: TLabel;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
SpinEdit1: TSpinEdit;
VpControlLink1: TVpControlLink;
VpDayView1: TVpDayView;
VpIniDatastore1: TVpIniDatastore;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SpinEdit1Change(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
VpDayView1.Date := EncodeDate(2022, 10, 1);
end;
procedure TForm1.SpinEdit1Change(Sender: TObject);
begin
VpDayView1.NumDays := SpinEdit1.Value;
end;
end.

View File

@ -0,0 +1,20 @@
[General]
Version=v105
[Resources]
1178568021={Description:Test}|{ResourceActive:true}
[Events of resource 1178568021]
1273124118={StartTime:2022/10/01 10:00:00}|{EndTime:2022/10/03 16:00:00}|{ResourceID:1178568021}|{Description:Test Oct-01-03}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1535857465={StartTime:2022/10/02 13:00:00}|{EndTime:2022/10/05 16:00:00}|{ResourceID:1178568021}|{Description:Test Oct 02-05}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1842424188={StartTime:2022/10/02 18:00:00}|{EndTime:2022/10/04 19:00:00}|{ResourceID:1178568021}|{Description:Test Oct 02-04}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1813046879={StartTime:2022/10/03 10:00:00}|{EndTime:2022/10/03 20:00:00}|{ResourceID:1178568021}|{Description:Test Oct 03}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1819459250={StartTime:2022/10/05 09:30:00}|{EndTime:2022/10/05 13:45:00}|{ResourceID:1178568021}|{Description:Test 4a}|{Category:4}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1170127712={StartTime:2022/10/05 10:30:00}|{EndTime:2022/10/05 19:00:00}|{ResourceID:1178568021}|{Description:Test 4}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
909791748={StartTime:2022/10/06 08:30:00}|{EndTime:2022/10/06 09:00:00}|{ResourceID:1178568021}|{Description:All-day}|{Category:3}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1339092840={StartTime:2022/10/06 09:30:00}|{EndTime:2022/10/08 18:00:00}|{ResourceID:1178568021}|{Description:Test 5}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1387047049={StartTime:2022/10/07 09:00:00}|{EndTime:2022/10/07 13:00:00}|{ResourceID:1178568021}|{Description:Test Recurring daily}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtCustom}|{RepeatRangeEnd:2022/10/30}|{CustomInterval:4}
939711377={StartTime:2022/10/08 10:00:00}|{EndTime:2022/10/08 10:30:00}|{ResourceID:1178568021}|{Description:Test}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1294424480={StartTime:2022/10/15 08:00:00}|{EndTime:2022/10/15 08:30:00}|{ResourceID:1178568021}|{Description:All-day event Oct 15}|{Category:2}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
638950699={StartTime:2022/10/26}|{EndTime:2022/11/03}|{ResourceID:1178568021}|{Description:Test All-day events Oct26-Nov3}|{Category:0}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
825453432={StartTime:2022/11/07 08:00:00}|{EndTime:2022/11/07 19:00:00}|{ResourceID:1178568021}|{Description:Test Nov-07}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="gvPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="gvPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="gvmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="gvMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="gvPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
<UseHeaptrc Value="True"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program gvPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, gvMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,175 @@
object Form1: TForm1
Left = 327
Height = 459
Top = 127
Width = 936
Caption = 'Form1'
ClientHeight = 459
ClientWidth = 936
OnCreate = FormCreate
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 924
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 924
TabOrder = 0
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
end
object VpGanttView1: TVpGanttView
Left = 0
Height = 421
Top = 38
Width = 936
PopupMenu = VpGanttView1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Align = alClient
TimeFormat = tf24Hour
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'GanttView'
Height = 100
ItemType = itGanttView
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'GanttView Portrait'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'GanttView'
Height = 100
ItemType = itGanttView
Left = 0
Rotation = ra180
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'GanttView Portrait Upside-down'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'data.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 304
Top = 99
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,88 @@
unit gvMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Spin, PrintersDlgs, VpBaseDS, VpIniDs, VpDayView, VpPrtPrvDlg, VpPrtFmtCBox,
VpData, VpWeekView, VpGanttView;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
VpControlLink1: TVpControlLink;
VpGanttView1: TVpGanttView;
VpIniDatastore1: TVpIniDatastore;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 3);
d2 := EncodeDate(2022, 10, 30);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 3);
d2 := EncodeDate(2022, 10, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
//VpGanttView1.ActualDate := EncodeDate(2022, 10, 1);
end;
end.

View File

@ -0,0 +1,21 @@
[General]
Version=v105
[Resources]
1178568021={Description:Test}|{ResourceActive:true}
[Events of resource 1178568021]
1273124118={StartTime:2022/10/01 10:00:00}|{EndTime:2022/10/01 12:30:00}|{ResourceID:1178568021}|{Description:Test event 1}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1535857465={StartTime:2022/10/02 13:00:00}|{EndTime:2022/10/02 16:00:00}|{ResourceID:1178568021}|{Description:Test event 2}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1842424188={StartTime:2022/10/02 18:00:00}|{EndTime:2022/10/02 19:00:00}|{ResourceID:1178568021}|{Description:Test event 2a}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1813046879={StartTime:2022/10/03 10:00:00}|{EndTime:2022/10/03 13:00:00}|{ResourceID:1178568021}|{Description:Test event 3}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1294424480={StartTime:2022/10/04 08:00:00}|{EndTime:2022/10/04 08:30:00}|{ResourceID:1178568021}|{Description:All-day event}|{Category:2}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1819459250={StartTime:2022/10/05 09:30:00}|{EndTime:2022/10/05 13:45:00}|{ResourceID:1178568021}|{Description:Test 4a}|{Category:4}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1170127712={StartTime:2022/10/05 10:30:00}|{EndTime:2022/10/05 19:00:00}|{ResourceID:1178568021}|{Description:Test 4}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
909791748={StartTime:2022/10/06 08:30:00}|{EndTime:2022/10/06 09:00:00}|{ResourceID:1178568021}|{Description:All-day}|{Category:3}|{AllDayEvent:true}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1387047049={StartTime:2022/10/07 09:00:00}|{EndTime:2022/10/07 13:00:00}|{ResourceID:1178568021}|{Description:Test 6}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
825453432={StartTime:2022/10/07 12:30:00}|{EndTime:2022/10/07 19:00:00}|{ResourceID:1178568021}|{Description:Test 6a}|{Category:2}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
939711377={StartTime:2022/10/08 10:00:00}|{EndTime:2022/10/08 10:30:00}|{ResourceID:1178568021}|{Description:Test}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
638950699={StartTime:2022/10/31 15:00:00}|{EndTime:2022/10/31 18:00:00}|{ResourceID:1178568021}|{Description:Test Oct-31}|{Category:0}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1339092840={StartTime:2022/11/06 10:00:00}|{EndTime:2022/11/06 15:00:00}|{ResourceID:1178568021}|{Description:Test Nov-10}|{Category:1}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}
1915067938={StartTime:2022/11/30 12:00:00}|{EndTime:2022/11/30 14:00:00}|{ResourceID:1178568021}|{Description:Test Nov-30}|{Category:3}|{AllDayEvent:false}|{AlarmSet:false}|{AlarmAdvance:15}|{AlarmAdvanceType:atMinutes}|{RepeatCode:rtNone}|{CustomInterval:0}

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="mvPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="mvPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="mvmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="mvMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="mvPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program mvPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, mvMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,225 @@
object Form1: TForm1
Left = 327
Height = 523
Top = 127
Width = 584
Caption = 'Form1'
ClientHeight = 523
ClientWidth = 584
OnCreate = FormCreate
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 572
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 572
TabOrder = 0
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
end
object VpMonthView1: TVpMonthView
Left = 0
Height = 485
Top = 38
Width = 584
ShowHint = True
PopupMenu = VpMonthView1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Font.Height = -12
ParentFont = False
ParentShowHint = False
Align = alClient
TabOrder = 1
DayHeadAttributes.Font.Height = -12
DayNumberFont.Height = -12
EventFont.Height = -12
HeadAttributes.Font.Height = -12
TodayAttributes.BorderPen.Color = clRed
TodayAttributes.BorderPen.Width = 3
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'MonthView'
Height = 100
ItemType = itMonthView
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'MonthView Portrait'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'MonthView'
Height = 100
ItemType = itMonthView
Left = 0
Rotation = ra180
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'MonthView Portrait Upside-down'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'MonthView'
Height = 100
ItemType = itMonthView
Left = 0
Rotation = ra90
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'MonthView Landscape 90°'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duMonth
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'MonthView'
Height = 100
ItemType = itMonthView
Left = 0
Rotation = ra270
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'MonthView Landscape 270°'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'data.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 304
Top = 99
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,96 @@
unit mvMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
PrintersDlgs, VpBaseDS, VpIniDs, VpPrtPrvDlg, VpPrtFmtCBox,
VpData, VpMonthView;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
VpControlLink1: TVpControlLink;
VpIniDatastore1: TVpIniDatastore;
VpMonthView1: TVpMonthView;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 12, 31);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 12, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
VpMonthView1.Date := EncodeDate(2022, 10, 1);
// The following properties require v1.0.7+
VpMonthView1.ApplyCategoryInfos := true;
VpIniDatastore1.CategoryColorMap.Category0.UseForAllDayEvents := true;
VpIniDatastore1.CategoryColorMap.Category1.UseForAllDayEvents := true;
VpIniDatastore1.CategoryColorMap.Category2.UseForAllDayEvents := true;
VpIniDatastore1.CategoryColorMap.Category3.UseForAllDayEvents := true;
VpIniDatastore1.CategoryColorMap.Category4.UseForAllDayEvents := true;
end;
end.

View File

@ -0,0 +1,99 @@
[General]
Version=v105
[Resources]
1178568021={Description:Test}|{ResourceActive:true}
[Tasks of resource 1178568021]
1={Complete:false}|{Description:Test 1}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/09/22}
2={Complete:false}|{Description:Test 2}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/01}
3={Complete:false}|{Description:Test 3}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/02}
4={Complete:false}|{Description:Test 4}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/03}
5={Complete:false}|{Description:Test 5}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/04}
6={Complete:false}|{Description:Test 6}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/05}
7={Complete:false}|{Description:Test 7}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/06}
8={Complete:false}|{Description:Test 8}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/07}
9={Complete:false}|{Description:Test 9}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/08}
10={Complete:false}|{Description:Test 10}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/09}
11={Complete:false}|{Description:Test 11}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/10}
12={Complete:false}|{Description:Test 12}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/11}
13={Complete:false}|{Description:Test 13}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/12}
14={Complete:false}|{Description:Test 14}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/13}
15={Complete:false}|{Description:Test 15}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/14}
16={Complete:false}|{Description:Test 16}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/15}
17={Complete:false}|{Description:Test 17}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/16}
18={Complete:false}|{Description:Test 18}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/17}
19={Complete:false}|{Description:Test 19}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/18}
20={Complete:false}|{Description:Test 20}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/19}
21={Complete:false}|{Description:Test 21}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/20}
22={Complete:false}|{Description:Test 22}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/21}
23={Complete:false}|{Description:Test 23}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/22}
24={Complete:false}|{Description:Test 24}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/23}
25={Complete:false}|{Description:Test 25}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/24}
26={Complete:false}|{Description:Test 26}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/25}
27={Complete:false}|{Description:Test 27}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/26}
28={Complete:false}|{Description:Test 28}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/27}
29={Complete:false}|{Description:Test 29}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/28}
30={Complete:false}|{Description:Test 30}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/29}
31={Complete:false}|{Description:Test 31}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/10/30}
32={Complete:false}|{Description:Test 32}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/01}
33={Complete:false}|{Description:Test 33}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/02}
34={Complete:false}|{Description:Test 34}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/03}
35={Complete:false}|{Description:Test 35}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/04}
36={Complete:false}|{Description:Test 36}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/05}
37={Complete:false}|{Description:Test 37}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/06}
38={Complete:false}|{Description:Test 38}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/07}
39={Complete:false}|{Description:Test 39}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/08}
40={Complete:false}|{Description:Test 40}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/09}
41={Complete:false}|{Description:Test 41}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/10}
42={Complete:false}|{Description:Test 42}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/11}
43={Complete:false}|{Description:Test 43}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/12}
44={Complete:false}|{Description:Test 44}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/13}
45={Complete:false}|{Description:Test 45}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/14}
46={Complete:false}|{Description:Test 46}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/15}
47={Complete:false}|{Description:Test 47}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/16}
48={Complete:false}|{Description:Test 48}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/17}
49={Complete:false}|{Description:Test 49}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/18}
50={Complete:false}|{Description:Test 50}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/19}
51={Complete:false}|{Description:Test 51}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/20}
52={Complete:false}|{Description:Test 52}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/21}
53={Complete:false}|{Description:Test 53}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/22}
54={Complete:false}|{Description:Test 54}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/23}
55={Complete:false}|{Description:Test 55}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/24}
56={Complete:false}|{Description:Test 56}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/25}
57={Complete:false}|{Description:Test 57}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/26}
58={Complete:false}|{Description:Test 58}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/27}
59={Complete:false}|{Description:Test 59}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/28}
60={Complete:false}|{Description:Test 60}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/29}
61={Complete:false}|{Description:Test 61}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/11/30}
62={Complete:false}|{Description:Test 62}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/01}
63={Complete:false}|{Description:Test 63}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/02}
64={Complete:false}|{Description:Test 64}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/03}
65={Complete:false}|{Description:Test 65}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/04}
66={Complete:false}|{Description:Test 66}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/05}
67={Complete:false}|{Description:Test 67}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/06}
68={Complete:false}|{Description:Test 68}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/07}
69={Complete:false}|{Description:Test 69}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/08}
70={Complete:false}|{Description:Test 70}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/09}
71={Complete:false}|{Description:Test 71}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/10}
72={Complete:false}|{Description:Test 72}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/11}
73={Complete:false}|{Description:Test 73}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/12}
74={Complete:false}|{Description:Test 74}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/13}
75={Complete:false}|{Description:Test 75}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/14}
76={Complete:false}|{Description:Test 76}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/15}
77={Complete:false}|{Description:Test 77}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/16}
78={Complete:false}|{Description:Test 78}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/17}
79={Complete:false}|{Description:Test 79}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/18}
80={Complete:false}|{Description:Test 80}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/19}
81={Complete:false}|{Description:Test 81}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/20}
82={Complete:false}|{Description:Test 82}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/21}
83={Complete:false}|{Description:Test 83}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/22}
84={Complete:false}|{Description:Test 84}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/23}
85={Complete:false}|{Description:Test 85}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/24}
86={Complete:false}|{Description:Test 86}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/25}
87={Complete:false}|{Description:Test 87}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/26}
88={Complete:false}|{Description:Test 88}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/27}
89={Complete:false}|{Description:Test 89}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/28}
90={Complete:false}|{Description:Test 90}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/29}
91={Complete:false}|{Description:Test 91}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/30}
92={Complete:false}|{Description:Test 92}|{CreatedOn:2022/10/05}|{Priority:0}|{Category:0}|{DueDate:2022/12/31}

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="tlPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="tlPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="tlmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="tlMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="tlPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program tlPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, tlMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,221 @@
object Form1: TForm1
Left = 327
Height = 523
Top = 127
Width = 636
Caption = 'Form1'
ClientHeight = 523
ClientWidth = 636
OnCreate = FormCreate
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 624
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 624
TabOrder = 0
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
end
object VpTaskList1: TVpTaskList
Left = 0
Height = 485
Top = 38
Width = 636
PopupMenu = VpTaskList1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Font.Height = -12
ParentFont = False
Align = alClient
TabOrder = 1
DisplayOptions.NormalColor = clBlack
LineColor = clGray
TaskHeadAttributes.Color = clSilver
TaskHeadAttributes.Font.Height = -12
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Portrait'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Rotation = ra270
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Landscape 270°'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Rotation = ra90
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Landscape 90°'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
Height = 100
ItemType = itTasks
Left = 0
Rotation = ra180
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'TaskList Portrait Upside-down'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'data.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 328
Top = 88
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,87 @@
unit tlMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Spin, PrintersDlgs, VpBaseDS, VpIniDs, VpDayView, VpPrtPrvDlg, VpPrtFmtCBox,
VpContactGrid, VpContactButtons, VpTaskList;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
VpControlLink1: TVpControlLink;
VpIniDatastore1: TVpIniDatastore;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
VpTaskList1: TVpTaskList;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers, OSPrinters;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 1);
d2 := EncodeDate(2022, 10, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
end;
end.

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="wvPrintDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="Printer4Lazarus"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit_design"/>
</Item>
<Item>
<PackageName Value="laz_visualplanit"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="wvPrintDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="wvmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="wvMain"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="wvPrintDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program wvPrintDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, wvMain, printer4lazarus
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,242 @@
object Form1: TForm1
Left = 327
Height = 523
Top = 127
Width = 584
Caption = 'Form1'
ClientHeight = 523
ClientWidth = 584
OnCreate = FormCreate
LCLVersion = '2.3.0.0'
object Panel1: TPanel
Left = 6
Height = 26
Top = 6
Width = 572
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 572
TabOrder = 0
object VpPrintFormatComboBox1: TVpPrintFormatComboBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 2
Width = 248
ControlLink = VpControlLink1
ItemHeight = 15
Sorted = True
TabOrder = 0
end
object btnPrintPreview: TButton
AnchorSideLeft.Control = VpPrintFormatComboBox1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 256
Height = 25
Top = 1
Width = 76
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Preview...'
OnClick = btnPrintPreviewClick
TabOrder = 1
end
object btnPrint: TButton
AnchorSideLeft.Control = btnPrintPreview
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 340
Height = 25
Top = 1
Width = 60
AutoSize = True
BorderSpacing.Left = 8
Caption = 'Print...'
OnClick = btnPrintClick
TabOrder = 2
end
end
object VpWeekView1: TVpWeekView
Left = 0
Height = 485
Top = 38
Width = 584
PopupMenu = VpWeekView1.default
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
Font.Height = -12
ParentFont = False
AllDayEventAttributes.Font.Height = -12
DayHeadAttributes.DateFormat = 'ddddd'
DayHeadAttributes.Font.Height = -13
EventFont.Height = -12
HeadAttributes.Font.Height = -12
Align = alClient
TabOrder = 1
end
object VpControlLink1: TVpControlLink
DataStore = VpIniDatastore1
Printer.BottomMargin = 1
Printer.DayStart = h_08
Printer.DayEnd = h_18
Printer.Granularity = gr30Min
Printer.LeftMargin = 1
Printer.MarginUnits = imCentimeters
Printer.PrintFormats = <
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duWeek
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
Height = 100
ItemType = itWeekView
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'WeekView Portrait'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duWeek
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
Height = 100
ItemType = itWeekView
Left = 0
Rotation = ra90
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'WeekView Landscape 90°'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duWeek
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
Height = 100
ItemType = itWeekView
Left = 0
Rotation = ra270
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'WeekView Landscape 270°'
end
item
Version = 'v1.0.7'
DayInc = 1
DayIncUnits = duWeek
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'Weekview'
Height = 100
ItemType = itWeekView
Left = 0
Rotation = ra180
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = 'WeekView Portrait Upside-down'
end
item
Version = 'v1.0.7'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
Height = 100
ItemType = itWeekView
Left = 0
Shape.Shape = ustRectangle
Top = 0
Width = 100
end>
FormatName = '_weekview test'
end>
Printer.RightMargin = 1
Printer.TopMargin = 1
Left = 187
Top = 207
end
object VpIniDatastore1: TVpIniDatastore
CategoryColorMap.Category0.BackgroundColor = clSkyBlue
CategoryColorMap.Category0.Description = 'Category 0'
CategoryColorMap.Category1.BackgroundColor = clMoneyGreen
CategoryColorMap.Category1.Color = clGreen
CategoryColorMap.Category1.Description = 'Category 1'
CategoryColorMap.Category2.BackgroundColor = 12171775
CategoryColorMap.Category2.Color = clRed
CategoryColorMap.Category2.Description = 'Category 2'
CategoryColorMap.Category3.BackgroundColor = clYellow
CategoryColorMap.Category3.Color = clOlive
CategoryColorMap.Category3.Description = 'Category 3'
CategoryColorMap.Category4.Description = 'Category 4'
CategoryColorMap.Category5.Description = 'Category 5'
CategoryColorMap.Category6.Description = 'Category 6'
CategoryColorMap.Category7.Description = 'Category 7'
CategoryColorMap.Category8.Description = 'Category 8'
CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray
AutoConnect = True
FileName = 'data.ini'
Left = 184
Top = 272
end
object PrintDialog1: TPrintDialog
Left = 304
Top = 99
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
DataStore = VpIniDatastore1
ControlLink = VpControlLink1
EndDate = 44844.8788724421
MarginUnits = imAbsolutePixel
StartDate = 44837.8788724421
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 480
Placement.Width = 720
Left = 184
Top = 96
end
end

View File

@ -0,0 +1,88 @@
unit wvMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Spin, PrintersDlgs, VpBaseDS, VpIniDs, VpDayView, VpPrtPrvDlg, VpPrtFmtCBox,
VpData, VpWeekView;
type
{ TForm1 }
TForm1 = class(TForm)
btnPrintPreview: TButton;
btnPrint: TButton;
Panel1: TPanel;
PrintDialog1: TPrintDialog;
VpControlLink1: TVpControlLink;
VpIniDatastore1: TVpIniDatastore;
VpPrintFormatComboBox1: TVpPrintFormatComboBox;
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
VpWeekView1: TVpWeekView;
procedure btnPrintPreviewClick(Sender: TObject);
procedure btnPrintClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Printers;
{ TForm1 }
procedure TForm1.btnPrintPreviewClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 3);
d2 := EncodeDate(2022, 10, 30);
VpPrintPreviewDialog1.StartDate := d1;
VpPrintPreviewDialog1.EndDate := d2;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;
try
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
end;
procedure TForm1.btnPrintClick(Sender: TObject);
var
d1, d2: TDateTime;
begin
d1 := EncodeDate(2022, 10, 3);
d2 := EncodeDate(2022, 10, 31);
Printer.BeginDoc;
try
VpControlLink1.Printer.Print(Printer, d1, d2);
finally
Printer.EndDoc;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if VpIniDatastore1.Resources.Count > 0 then
VpIniDatastore1.Resource := VpIniDatastore1.Resources.Items[0];
VpWeekView1.Date := EncodeDate(2022, 10, 1);
end;
end.