You've already forked lazarus-ccr
tvplanit: Initial version with printing capabilities (still lots of bugs...)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4903 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -28,13 +28,16 @@
|
|||||||
<FormatVersion Value="1"/>
|
<FormatVersion Value="1"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="2">
|
<RequiredPackages Count="3">
|
||||||
<Item1>
|
<Item1>
|
||||||
<PackageName Value="laz_visualplanit"/>
|
<PackageName Value="Printer4Lazarus"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
<Item2>
|
<Item2>
|
||||||
<PackageName Value="LCL"/>
|
<PackageName Value="laz_visualplanit"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item3>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="2">
|
<Units Count="2">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
|
@ -7,7 +7,8 @@ uses
|
|||||||
cthreads,
|
cthreads,
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Interfaces, // this includes the LCL widgetset
|
Interfaces, // this includes the LCL widgetset
|
||||||
Forms, demoMain, laz_visualplanit, LCLTranslator, DefaultTranslator;
|
Forms, demoMain, laz_visualplanit, LCLTranslator, DefaultTranslator,
|
||||||
|
printer4lazarus;
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
@ -689,15 +689,52 @@ object MainForm: TMainForm
|
|||||||
object VpControlLink1: TVpControlLink
|
object VpControlLink1: TVpControlLink
|
||||||
DataStore = VpBufDSDataStore1
|
DataStore = VpBufDSDataStore1
|
||||||
LocalizationFile = '../../source/vplocalize.xml'
|
LocalizationFile = '../../source/vplocalize.xml'
|
||||||
Printer.BottomMargin = 0
|
Printer.BottomMargin = 5
|
||||||
Printer.DayStart = h_08
|
Printer.DayStart = h_07
|
||||||
Printer.DayEnd = h_05
|
Printer.DayEnd = h_18
|
||||||
Printer.Granularity = gr30Min
|
Printer.Granularity = gr60Min
|
||||||
Printer.LeftMargin = 0
|
Printer.LeftMargin = 5
|
||||||
Printer.MarginUnits = imAbsolutePixel
|
Printer.MarginUnits = imPercent
|
||||||
Printer.PrintFormats = <>
|
Printer.PrintFormats = <
|
||||||
Printer.RightMargin = 0
|
item
|
||||||
Printer.TopMargin = 0
|
Version = 'v1.04'
|
||||||
|
DayInc = 0
|
||||||
|
DayIncUnits = duDay
|
||||||
|
Elements = <
|
||||||
|
item
|
||||||
|
Version = 'v1.04'
|
||||||
|
Caption.Caption = 'Current week'
|
||||||
|
Caption.Font.Style = [fsItalic]
|
||||||
|
DayOffset = 1
|
||||||
|
DayOffsetUnits = duDay
|
||||||
|
Height = 100
|
||||||
|
Left = 0
|
||||||
|
Shape.Shape = ustRectangle
|
||||||
|
Top = 0
|
||||||
|
Width = 100
|
||||||
|
end>
|
||||||
|
FormatName = 'Current week (dayview)'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Version = 'v1.04'
|
||||||
|
DayInc = 0
|
||||||
|
DayIncUnits = duWeek
|
||||||
|
Elements = <
|
||||||
|
item
|
||||||
|
Version = 'v1.04'
|
||||||
|
DayOffset = 0
|
||||||
|
DayOffsetUnits = duDay
|
||||||
|
Height = 100
|
||||||
|
ItemType = itWeekView
|
||||||
|
Left = 0
|
||||||
|
Shape.Shape = ustRectangle
|
||||||
|
Top = 0
|
||||||
|
Width = 100
|
||||||
|
end>
|
||||||
|
FormatName = 'Current week (Week view)'
|
||||||
|
end>
|
||||||
|
Printer.RightMargin = 5
|
||||||
|
Printer.TopMargin = 5
|
||||||
left = 312
|
left = 312
|
||||||
top = 200
|
top = 200
|
||||||
end
|
end
|
||||||
@ -1910,6 +1947,13 @@ object MainForm: TMainForm
|
|||||||
top = 221
|
top = 221
|
||||||
object MenuItem1: TMenuItem
|
object MenuItem1: TMenuItem
|
||||||
Caption = 'File'
|
Caption = 'File'
|
||||||
|
object MnuPrintPreview: TMenuItem
|
||||||
|
Caption = 'Print preview...'
|
||||||
|
OnClick = MnuPrintPreviewClick
|
||||||
|
end
|
||||||
|
object MenuItem3: TMenuItem
|
||||||
|
Caption = '-'
|
||||||
|
end
|
||||||
object MnuQuit: TMenuItem
|
object MnuQuit: TMenuItem
|
||||||
Caption = 'Quit'
|
Caption = 'Quit'
|
||||||
OnClick = MnuQuitClick
|
OnClick = MnuQuitClick
|
||||||
@ -1934,4 +1978,28 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object PrintDialog1: TPrintDialog
|
||||||
|
left = 560
|
||||||
|
top = 128
|
||||||
|
end
|
||||||
|
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
|
||||||
|
Version = 'v1.04'
|
||||||
|
DataStore = VpBufDSDataStore1
|
||||||
|
BottomMargin = 5
|
||||||
|
ControlLink = VpControlLink1
|
||||||
|
EndDate = 42561.5151169907
|
||||||
|
LeftMargin = 5
|
||||||
|
MarginUnits = imPercent
|
||||||
|
RightMargin = 5
|
||||||
|
StartDate = 42554.5151169907
|
||||||
|
TopMargin = 5
|
||||||
|
Options = [doSizeable]
|
||||||
|
Placement.Position = mpCenter
|
||||||
|
Placement.Top = 10
|
||||||
|
Placement.Left = 10
|
||||||
|
Placement.Height = 500
|
||||||
|
Placement.Width = 1000
|
||||||
|
left = 560
|
||||||
|
top = 192
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,6 +23,8 @@ TMAINFORM.COMBOBOX1.TEXT=ComboBox1
|
|||||||
TMAINFORM.CBDRAWINGSTYLE.TEXT=flat
|
TMAINFORM.CBDRAWINGSTYLE.TEXT=flat
|
||||||
TMAINFORM.TITLELBL.CAPTION=TitleLbl
|
TMAINFORM.TITLELBL.CAPTION=TitleLbl
|
||||||
TMAINFORM.MENUITEM1.CAPTION=File
|
TMAINFORM.MENUITEM1.CAPTION=File
|
||||||
|
TMAINFORM.MNUPRINTPREVIEW.CAPTION=Print preview...
|
||||||
|
TMAINFORM.MENUITEM3.CAPTION=-
|
||||||
TMAINFORM.MNUQUIT.CAPTION=Quit
|
TMAINFORM.MNUQUIT.CAPTION=Quit
|
||||||
TMAINFORM.MNUMAINTENANCE.CAPTION=Maintenance
|
TMAINFORM.MNUMAINTENANCE.CAPTION=Maintenance
|
||||||
TMAINFORM.MNURESOURCES.CAPTION=Resources
|
TMAINFORM.MNURESOURCES.CAPTION=Resources
|
||||||
|
@ -5,11 +5,10 @@ unit demoMain;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
Classes, SysUtils, FileUtil, PrintersDlgs, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls, ComCtrls, LCLTranslator, Menus,
|
ExtCtrls, StdCtrls, ComCtrls, LCLTranslator, Menus, VpBaseDS, VpDayView,
|
||||||
VpBaseDS, VpDayView, VpWeekView, VpTaskList, VpAbout,
|
VpWeekView, VpTaskList, VpAbout, VpContactGrid, VpMonthView, VpResEditDlg,
|
||||||
VpContactGrid, VpMonthView, VpResEditDlg, VpContactButtons, VpBufDS, VpNavBar,
|
VpContactButtons, VpBufDS, VpNavBar, VpData, VpPrtPrvDlg, Types;
|
||||||
VpData, Types;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -36,6 +35,9 @@ type
|
|||||||
LblGranularity: TLabel;
|
LblGranularity: TLabel;
|
||||||
LblLanguage: TLabel;
|
LblLanguage: TLabel;
|
||||||
LblVisibleDays: TLabel;
|
LblVisibleDays: TLabel;
|
||||||
|
MenuItem3: TMenuItem;
|
||||||
|
MnuPrintPreview: TMenuItem;
|
||||||
|
PrintDialog1: TPrintDialog;
|
||||||
TitleLbl: TLabel;
|
TitleLbl: TLabel;
|
||||||
MainMenu1: TMainMenu;
|
MainMenu1: TMainMenu;
|
||||||
MenuItem1: TMenuItem;
|
MenuItem1: TMenuItem;
|
||||||
@ -68,6 +70,7 @@ type
|
|||||||
VpDayView1: TVpDayView;
|
VpDayView1: TVpDayView;
|
||||||
VpMonthView1: TVpMonthView;
|
VpMonthView1: TVpMonthView;
|
||||||
VpNavBar1: TVpNavBar;
|
VpNavBar1: TVpNavBar;
|
||||||
|
VpPrintPreviewDialog1: TVpPrintPreviewDialog;
|
||||||
VpResourceCombo1: TVpResourceCombo;
|
VpResourceCombo1: TVpResourceCombo;
|
||||||
VpResourceEditDialog1: TVpResourceEditDialog;
|
VpResourceEditDialog1: TVpResourceEditDialog;
|
||||||
VpTaskList1: TVpTaskList;
|
VpTaskList1: TVpTaskList;
|
||||||
@ -85,6 +88,7 @@ type
|
|||||||
procedure CbTimeFormatChange(Sender: TObject);
|
procedure CbTimeFormatChange(Sender: TObject);
|
||||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure MnuPrintPreviewClick(Sender: TObject);
|
||||||
procedure MnuQuitClick(Sender: TObject);
|
procedure MnuQuitClick(Sender: TObject);
|
||||||
procedure MnuResourcesClick(Sender: TObject);
|
procedure MnuResourcesClick(Sender: TObject);
|
||||||
procedure MnuSettingsClick(Sender: TObject);
|
procedure MnuSettingsClick(Sender: TObject);
|
||||||
@ -129,8 +133,9 @@ uses
|
|||||||
{$IFDEF WINDOWS}
|
{$IFDEF WINDOWS}
|
||||||
Windows,
|
Windows,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LResources, LazFileUtils, LazUTF8, StrUtils, Translations, IniFiles, Math,
|
LResources, LazFileUtils, LazUTF8, StrUtils, DateUtils, Translations,
|
||||||
VpMisc, VpBase;
|
IniFiles, Math, Printers,
|
||||||
|
VpMisc, VpBase, VpPrtFmt;
|
||||||
|
|
||||||
const
|
const
|
||||||
LANGUAGE_DIR = '..\..\languages\';
|
LANGUAGE_DIR = '..\..\languages\';
|
||||||
@ -348,6 +353,45 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.MnuPrintPreviewClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
t1, t2: TDateTime;
|
||||||
|
fmt: TVpPrintFormatItem;
|
||||||
|
fmtidx: Integer;
|
||||||
|
begin
|
||||||
|
fmtidx := VpPrintPreviewDialog1.ControlLink.Printer.CurFormat;
|
||||||
|
fmt := VpPrintPreviewDialog1.ControlLink.Printer.PrintFormats.Items[fmtidx];
|
||||||
|
case fmtidx of
|
||||||
|
0: begin // current week in DayView
|
||||||
|
t1 := StartOfTheWeek(now);
|
||||||
|
t2 := t1 + 7 - VpDayView1.NumDays mod 7; // + 7;
|
||||||
|
fmt.DayInc := VpDayView1.NumDays;
|
||||||
|
VpControlLink1.Printer.Granularity := VpDayView1.Granularity;
|
||||||
|
VpControlLink1.Printer.DayStart := h_08; //VpDayView1.DefaultTopHour;
|
||||||
|
VpControlLink1.Printer.DayEnd := h_17;
|
||||||
|
end;
|
||||||
|
1: begin // current week in WeekView
|
||||||
|
t1 := StartOfTheWeek(now);
|
||||||
|
t2 := t1; // it all fits on one single page
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
VpPrintPreviewDialog1.ControlLink := VpControlLink1;
|
||||||
|
VpPrintPreviewDialog1.Printer := Printer;
|
||||||
|
VpPrintPreviewDialog1.StartDate := t1;
|
||||||
|
VPPrintPreviewDialog1.EndDate := t2;
|
||||||
|
if VpPrintPreviewDialog1.Execute then
|
||||||
|
if PrintDialog1.Execute then begin
|
||||||
|
Printer.BeginDoc;
|
||||||
|
try
|
||||||
|
t1 := VpPrintPreviewDialog1.StartDate;
|
||||||
|
t2 := VpPrintPreviewDialog1.EndDate;
|
||||||
|
VpPrintPreviewDialog1.ControlLink.Printer.Print(Printer, t1, t2);
|
||||||
|
finally
|
||||||
|
Printer.EndDoc;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.MnuSettingsClick(Sender: TObject);
|
procedure TMainForm.MnuSettingsClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
ShowSettings;
|
ShowSettings;
|
||||||
|
@ -256,6 +256,10 @@ msgstr "Datei"
|
|||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr "Hilfe"
|
msgstr "Hilfe"
|
||||||
|
|
||||||
|
#: tmainform.menuitem3.caption
|
||||||
|
msgid "-"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: tmainform.mnuabout.caption
|
#: tmainform.mnuabout.caption
|
||||||
msgid "About Visual PlanIt"
|
msgid "About Visual PlanIt"
|
||||||
msgstr "Über Visual PlanIt"
|
msgstr "Über Visual PlanIt"
|
||||||
@ -265,6 +269,10 @@ msgctxt "tmainform.mnumaintenance.caption"
|
|||||||
msgid "Maintenance"
|
msgid "Maintenance"
|
||||||
msgstr "Wartung"
|
msgstr "Wartung"
|
||||||
|
|
||||||
|
#: tmainform.mnuprintpreview.caption
|
||||||
|
msgid "Print preview..."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: tmainform.mnuquit.caption
|
#: tmainform.mnuquit.caption
|
||||||
msgid "Quit"
|
msgid "Quit"
|
||||||
msgstr "Beenden"
|
msgstr "Beenden"
|
||||||
|
@ -245,6 +245,10 @@ msgstr ""
|
|||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: tmainform.menuitem3.caption
|
||||||
|
msgid "-"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: tmainform.mnuabout.caption
|
#: tmainform.mnuabout.caption
|
||||||
msgid "About Visual PlanIt"
|
msgid "About Visual PlanIt"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -254,6 +258,10 @@ msgctxt "TMAINFORM.MNUMAINTENANCE.CAPTION"
|
|||||||
msgid "Maintenance"
|
msgid "Maintenance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: tmainform.mnuprintpreview.caption
|
||||||
|
msgid "Print preview..."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: tmainform.mnuquit.caption
|
#: tmainform.mnuquit.caption
|
||||||
msgid "Quit"
|
msgid "Quit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -202,7 +202,7 @@ constructor TVpPrintPreviewDialog.Create(AOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create (AOwner);
|
inherited Create (AOwner);
|
||||||
FPlacement.Height := 480;
|
FPlacement.Height := 480;
|
||||||
FPlacement.Width := 640;
|
FPlacement.Width := 720;
|
||||||
StartDate := Now;
|
StartDate := Now;
|
||||||
EndDate := Now + 7;
|
EndDate := Now + 7;
|
||||||
FZoomFactor := zfFitToControl;
|
FZoomFactor := zfFitToControl;
|
||||||
|
Reference in New Issue
Block a user