tvplanit: Add translatable captions and hints to print preview dialog

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4791 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-21 13:48:55 +00:00
parent ed9905a382
commit 1ae439b458
6 changed files with 297 additions and 192 deletions

View File

@ -164,6 +164,7 @@ msgid "CW"
msgstr "KW" msgstr "KW"
#: vpsr.rscancelbtn #: vpsr.rscancelbtn
msgctxt "vpsr.rscancelbtn"
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
@ -809,24 +810,59 @@ msgid "Position:"
msgstr "Position" msgstr "Position"
#: vpsr.rsprintbtn #: vpsr.rsprintbtn
msgctxt "vpsr.rsprintbtn"
msgid "&Print" msgid "&Print"
msgstr "&Drucken" msgstr "&Drucken"
#: vpsr.rsprintprvcancel
msgctxt "vpsr.rsprintprvcancel"
msgid "Cancel"
msgstr "Abbrechen"
#: vpsr.rsprintprvcancelhint
msgid "Cancel preview"
msgstr "Durckvorschau abbrechen"
#: vpsr.rsprintprvfirstpage #: vpsr.rsprintprvfirstpage
msgid "First Page" msgid "&First page"
msgstr "Erste Seite" msgstr "&Erste Seite"
#: vpsr.rsprintprvfirstpagehint
msgid "Go to first page"
msgstr "Zur ersten Seite gehen"
#: vpsr.rsprintprvlastpage #: vpsr.rsprintprvlastpage
msgid "Last Page" msgid "&Last page"
msgstr "Letzte Seite" msgstr "&Letzte Seite"
#: vpsr.rsprintprvlastpagehint
msgid "Go to last page"
msgstr "Zur letzten Seite gehen"
#: vpsr.rsprintprvnextpage #: vpsr.rsprintprvnextpage
msgid "Next Page" msgid "&Next page"
msgstr "Nächste Seite" msgstr "&Nächste Seite"
#: vpsr.rsprintprvnextpagehint
msgid "Go to next page"
msgstr "Zur nächsten Seite gehen"
#: vpsr.rsprintprvprevpage #: vpsr.rsprintprvprevpage
msgid "Previous Page" msgid "Pre&vious page"
msgstr "Vorige Seite" msgstr "&Vorige Seite"
#: vpsr.rsprintprvprevpagehint
msgid "Go to previous page"
msgstr "Zur vorigen Seite gehen"
#: vpsr.rsprintprvprint
msgctxt "vpsr.rsprintprvprint"
msgid "&Print"
msgstr "&Drucken"
#: vpsr.rsprintprvprinthint
msgid "Print"
msgstr "Drucken"
#: vpsr.rsprtcontrolowner #: vpsr.rsprtcontrolowner
msgid "Print controller is not owned by a TVpControlLink!" msgid "Print controller is not owned by a TVpControlLink!"

View File

@ -154,6 +154,7 @@ msgid "CW"
msgstr "" msgstr ""
#: vpsr.rscancelbtn #: vpsr.rscancelbtn
msgctxt "vpsr.rscancelbtn"
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
@ -799,23 +800,58 @@ msgid "Position:"
msgstr "" msgstr ""
#: vpsr.rsprintbtn #: vpsr.rsprintbtn
msgctxt "vpsr.rsprintbtn"
msgid "&Print" msgid "&Print"
msgstr "" msgstr ""
#: vpsr.rsprintprvcancel
msgctxt "vpsr.rsprintprvcancel"
msgid "Cancel"
msgstr ""
#: vpsr.rsprintprvcancelhint
msgid "Cancel preview"
msgstr ""
#: vpsr.rsprintprvfirstpage #: vpsr.rsprintprvfirstpage
msgid "First Page" msgid "&First page"
msgstr ""
#: vpsr.rsprintprvfirstpagehint
msgid "Go to first page"
msgstr "" msgstr ""
#: vpsr.rsprintprvlastpage #: vpsr.rsprintprvlastpage
msgid "Last Page" msgid "&Last page"
msgstr ""
#: vpsr.rsprintprvlastpagehint
msgid "Go to last page"
msgstr "" msgstr ""
#: vpsr.rsprintprvnextpage #: vpsr.rsprintprvnextpage
msgid "Next Page" msgid "&Next page"
msgstr ""
#: vpsr.rsprintprvnextpagehint
msgid "Go to next page"
msgstr "" msgstr ""
#: vpsr.rsprintprvprevpage #: vpsr.rsprintprvprevpage
msgid "Previous Page" msgid "Pre&vious page"
msgstr ""
#: vpsr.rsprintprvprevpagehint
msgid "Go to previous page"
msgstr ""
#: vpsr.rsprintprvprint
msgctxt "vpsr.rsprintprvprint"
msgid "&Print"
msgstr ""
#: vpsr.rsprintprvprinthint
msgid "Print"
msgstr "" msgstr ""
#: vpsr.rsprtcontrolowner #: vpsr.rsprtcontrolowner

View File

@ -164,6 +164,7 @@ msgid "CW"
msgstr "" msgstr ""
#: vpsr.rscancelbtn #: vpsr.rscancelbtn
msgctxt "vpsr.rscancelbtn"
msgid "Cancel" msgid "Cancel"
msgstr "Отмена" msgstr "Отмена"
@ -171,45 +172,9 @@ msgstr "Отмена"
msgid "Category" msgid "Category"
msgstr "Категория" msgstr "Категория"
#: vpsr.rscategorydesc0 #: vpsr.rscategorydesc
msgid "Category 0" msgid "Category %d"
msgstr "Категория 0" msgstr ""
#: vpsr.rscategorydesc1
msgid "Category 1"
msgstr "Категория 1"
#: vpsr.rscategorydesc2
msgid "Category 2"
msgstr "Категория 2"
#: vpsr.rscategorydesc3
msgid "Category 3"
msgstr "Категория 3"
#: vpsr.rscategorydesc4
msgid "Category 4"
msgstr "Категория 4"
#: vpsr.rscategorydesc5
msgid "Category 5"
msgstr "Категория 5"
#: vpsr.rscategorydesc6
msgid "Category 6"
msgstr "Категория 6"
#: vpsr.rscategorydesc7
msgid "Category 7"
msgstr "Категория 7"
#: vpsr.rscategorydesc8
msgid "Category 8"
msgstr "Категория 8"
#: vpsr.rscategorydesc9
msgid "Category 9"
msgstr "Категория 9"
#: vpsr.rscategorylabel1 #: vpsr.rscategorylabel1
msgid "Business" msgid "Business"
@ -845,25 +810,70 @@ msgid "Position:"
msgstr "Позиция:" msgstr "Позиция:"
#: vpsr.rsprintbtn #: vpsr.rsprintbtn
msgctxt "vpsr.rsprintbtn"
msgid "&Print" msgid "&Print"
msgstr "Печать" msgstr "Печать"
#: vpsr.rsprintprvcancel
#, fuzzy
msgctxt "vpsr.rsprintprvcancel"
msgid "Cancel"
msgstr "Отмена"
#: vpsr.rsprintprvcancelhint
msgid "Cancel preview"
msgstr ""
#: vpsr.rsprintprvfirstpage #: vpsr.rsprintprvfirstpage
msgid "First Page" #, fuzzy
#| msgid "First Page"
msgid "&First page"
msgstr "Первая страницы" msgstr "Первая страницы"
#: vpsr.rsprintprvfirstpagehint
msgid "Go to first page"
msgstr ""
#: vpsr.rsprintprvlastpage #: vpsr.rsprintprvlastpage
msgid "Last Page" #, fuzzy
#| msgid "Last Page"
msgid "&Last page"
msgstr "Последняя страница" msgstr "Последняя страница"
#: vpsr.rsprintprvlastpagehint
msgid "Go to last page"
msgstr ""
#: vpsr.rsprintprvnextpage #: vpsr.rsprintprvnextpage
msgid "Next Page" #, fuzzy
#| msgid "Next Page"
msgid "&Next page"
msgstr "Следующая страница" msgstr "Следующая страница"
#: vpsr.rsprintprvnextpagehint
msgid "Go to next page"
msgstr ""
#: vpsr.rsprintprvprevpage #: vpsr.rsprintprvprevpage
msgid "Previous Page" #, fuzzy
#| msgid "Previous Page"
msgid "Pre&vious page"
msgstr "Предыдущая страница" msgstr "Предыдущая страница"
#: vpsr.rsprintprvprevpagehint
msgid "Go to previous page"
msgstr ""
#: vpsr.rsprintprvprint
#, fuzzy
msgctxt "vpsr.rsprintprvprint"
msgid "&Print"
msgstr "Печать"
#: vpsr.rsprintprvprinthint
msgid "Print"
msgstr ""
#: vpsr.rsprtcontrolowner #: vpsr.rsprtcontrolowner
msgid "Print controller is not owned by a TVpControlLink!" msgid "Print controller is not owned by a TVpControlLink!"
msgstr "" msgstr ""
@ -1372,3 +1382,4 @@ msgstr ""
#: vpsr.sxmldecnotatbeg #: vpsr.sxmldecnotatbeg
msgid "The XML declaration must appear before the first element" msgid "The XML declaration must appear before the first element"
msgstr "" msgstr ""

View File

@ -53,31 +53,27 @@ object frmPrintPreview: TfrmPrintPreview
end end
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 1 Left = 1
Height = 29 Height = 27
Top = 1 Top = 1
Width = 475 Width = 475
AutoSize = True
ButtonHeight = 25 ButtonHeight = 25
ButtonWidth = 25
Caption = 'ToolBar1' Caption = 'ToolBar1'
EdgeBorders = [ebBottom]
Images = imMain Images = imMain
List = True
ParentShowHint = False ParentShowHint = False
ShowCaptions = True
ShowHint = True ShowHint = True
TabOrder = 0 TabOrder = 0
object btnCancel: TSpeedButton
Left = 132
Height = 25
Top = 2
Width = 77
Action = actCancel
Flat = True
Transparent = False
end
object btnPrint: TToolButton object btnPrint: TToolButton
Left = 1 Left = 1
Top = 2 Top = 2
Action = actPrint Action = actPrint
end end
object ToolButton3: TToolButton object ToolButton3: TToolButton
Left = 24 Left = 52
Height = 25 Height = 25
Top = 2 Top = 2
Width = 8 Width = 8
@ -86,27 +82,31 @@ object frmPrintPreview: TfrmPrintPreview
Style = tbsDivider Style = tbsDivider
end end
object btnFirstPage: TToolButton object btnFirstPage: TToolButton
Left = 32 Left = 60
Top = 2 Top = 2
Action = actFirstPage Action = actFirstPage
ShowCaption = False
end end
object btnPrevPage: TToolButton object btnPrevPage: TToolButton
Left = 55 Left = 85
Top = 2 Top = 2
Action = actPrevPage Action = actPrevPage
ShowCaption = False
end end
object btnNextPage: TToolButton object btnNextPage: TToolButton
Left = 78 Left = 110
Top = 2 Top = 2
Action = actNextPage Action = actPrevPage
ShowCaption = False
end end
object btnLastPage: TToolButton object btnLastPage: TToolButton
Left = 101 Left = 135
Top = 2 Top = 2
Action = actLastPage Action = actLastPage
ShowCaption = False
end end
object ToolButton8: TToolButton object ToolButton8: TToolButton
Left = 124 Left = 160
Height = 25 Height = 25
Top = 2 Top = 2
Width = 8 Width = 8
@ -114,6 +114,11 @@ object frmPrintPreview: TfrmPrintPreview
ImageIndex = 6 ImageIndex = 6
Style = tbsDivider Style = tbsDivider
end end
object btnCancel: TToolButton
Left = 168
Top = 2
Action = actCancel
end
end end
end end
object VpPrintPreview1: TVpPrintPreview object VpPrintPreview1: TVpPrintPreview
@ -133,7 +138,7 @@ object frmPrintPreview: TfrmPrintPreview
left = 357 left = 357
top = 195 top = 195
Bitmap = { Bitmap = {
4C690500000010000000100000005B4848005B4848005B484800564343008679 4C690600000010000000100000005B4848005B4848005B484800564343008679
799CD1CDCDF3D1CDCDEFD0CCCCEFD1CCCCEFD2CDCDEFD3CDCDF38E8181A75747 799CD1CDCDF3D1CDCDEFD0CCCCEFD1CCCCEFD2CDCDEFD3CDCDF38E8181A75747
47025D4D4D005D4D4D005D4D4D005642420056424200554242004D3A3A009387 47025D4D4D005D4D4D005D4D4D005642420056424200554242004D3A3A009387
87AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9494BB4F3F 87AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9494BB4F3F
@ -293,7 +298,39 @@ object frmPrintPreview: TfrmPrintPreview
0000CD500000B7450000BB470000BD49016FC65108FFC0490287C0480001C149 0000CD500000B7450000BB470000BD49016FC65108FFC0490287C0480001C149
0000C1490000C1490000C1490000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 0000C1490000C1490000C1490000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00 FF00FFFFFF00FFFFFF00FFFFFF001919770014146E1F252596C32424A8F41A1A
7B5818187A00161680001515850013138700111188000E0E85000E0E884B2525
B0F22323A9CF01018A29030393001818731F22228EC35A5AEBFF6868FFFF1D1D
B3F618187B5B16167E001515850013138700111186000D0D844C1F1FB5F18787
FDFF8484F2FF1E1EA9CC00008F2B2D2D95C95B5BEDFFC9C9FFFFEDEDFFFF6969
FBFF1111B9F61515805915158400131386000F0F864A1515B8F17474F8FFEBEB
FFFFDEDEFFFF8B8BF3FF2D2DB0D53535A8F66E6EFFFFD4D4FFFFDFDFFFFFD3D3
FFFF5D5DF7FF0808B6F413138553101086450B0BB3F26262F4FFD2D2FFFFD9D9
FFFFD6D6FFFFAAAAFFFF4343C2FB19197B5A3333B6F46767FDFFBBBBFFFFC8C8
FFFFC4C4FFFF4D4DF4FF0101B6FB0202B0F84C4CF1FFC1C1FFFFC6C6FFFFBFBF
FFFF9494FEFF4343CAF80505986A13137900151579592929BDF65C5CFCFFAAAA
FFFFB4B4FFFFB0B0FDFF3D3DECFF3636EAFFABABFDFFB3B3FFFFACACFFFF8181
FDFF3B3BCDFB0404936B0000940015157A001010780014147E5B2020B9F74B4B
FAFF9393FFFFA0A0FFFF9696FDFF9595FDFF9F9FFFFF9696FEFF6A6AFBFF2C2C
C8FB0303946B000091000101960015157A0012127A000F0F7C00101082501818
B7F94242F4FF8585FFFF8F8FFFFF8E8EFFFF8787FEFF5757F5FF1F1FC5FC0101
955D0000920000009400010196000A0A8900080887000A0A8500101084402222
B5F70E0EE7FF2A2AE8FF4242EAFF4242EAFF3737E7FF2929E7FF2323C2FA0101
964D0000980000009E000000A3000A0A8900050585000F0F844C2C2CB7F21818
F0FF0000E0FF0000D5FF0000CCFF0000CCFF0B0BD4FF2020DFFF3D3DEEFF3030
C6F602029A5B00009C000000A300080888000C0C844A3535BCF11E1EF5FF0000
EAFF0000DFFF0000D7FF0101DBFF0606DCFF1313D7FF2222DEFF2F2FE7FF4E4E
F4FF3D3DCCF603039D590000A2000F0F894E3838B8F22525FAFF0000F1FF0000
E5FF0000DFFF0505E3FF0A0AC5FD0B0BC1FB1616E3FF2121DFFF2E2EE4FF3C3C
EEFF6060F9FF4343CBF40404A45E3939B1F23030FFFF0000F8FF0000EBFF0000
E7FF0A0AEBFF1313C7F80A0A9660060695511313C5F42929E9FF2F2FE6FF3C3C
EAFF4646F4FF7777FFFF4545C9F72E2EAAD43636F3FF0505FAFF0000ECFF1010
F1FF1C1CCCFB0909956B080893000606940002029A591E1ECBF63A3AEFFF3B3B
ECFF4C4CF6FF7171F7FF3434C0DF09098B2B2B2BA9CC2E2EF1FF1A1AFBFF2424
C9FB0A0A966B0505920009099500070795000101970001019C5B2727CAF64F4F
F7FF6161F5FF2E2EBDD70000A2380A0A8E0006068B292323B2CD2828C2F90909
9869050593000707940009099500070795000202990000009A000202A45B2A2A
C9F52525C1DA0000A0370101A400
} }
end end
object actMain: TActionList object actMain: TActionList
@ -337,13 +374,11 @@ object frmPrintPreview: TfrmPrintPreview
ShortCut = 16460 ShortCut = 16460
end end
object actCancel: TAction object actCancel: TAction
Caption = 'Cancel preview'
Hint = 'Cancel preview' Hint = 'Cancel preview'
ImageIndex = 5
OnExecute = actCancelExecute OnExecute = actCancelExecute
ShortCut = 32835 ShortCut = 32835
end end
end end
object ImageList1: TImageList
left = 181
top = 273
end
end end

View File

@ -36,7 +36,7 @@ uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LResources, LMessages, LCLProc, LCLType, LCLIntf, LResources,
{$ELSE} {$ELSE}
Windows,Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
SysUtils, SysUtils,
Classes, Classes,
@ -64,12 +64,12 @@ type
{ TfrmPrintPreview } { TfrmPrintPreview }
TfrmPrintPreview = class (TForm) TfrmPrintPreview = class(TForm)
ImageList1: TImageList; Panel1: TPanel;
Panel1 : TPanel; cboxZoom: TComboBox;
cboxZoom : TComboBox; btnCancel: TToolButton;
VpPrintPreview1 : TVpPrintPreview; VpPrintPreview1: TVpPrintPreview;
VpPrintFormatComboBox1 : TVpPrintFormatComboBox; VpPrintFormatComboBox1: TVpPrintFormatComboBox;
ToolBar1: TToolBar; ToolBar1: TToolBar;
btnPrint: TToolButton; btnPrint: TToolButton;
ToolButton3: TToolButton; ToolButton3: TToolButton;
@ -86,13 +86,8 @@ type
actNextPage: TAction; actNextPage: TAction;
actLastPage: TAction; actLastPage: TAction;
actCancel: TAction; actCancel: TAction;
btnCancel: TSpeedButton;
procedure OKBtnClick (Sender : TObject); procedure OKBtnClick (Sender : TObject);
procedure btnFirstPageClick(Sender: TObject);
procedure btnPrevPageClick(Sender: TObject);
procedure btnNextPageClick(Sender: TObject);
procedure btnLastPageClick(Sender: TObject);
procedure cboxZoomChange(Sender: TObject); procedure cboxZoomChange(Sender: TObject);
procedure actPrintExecute(Sender: TObject); procedure actPrintExecute(Sender: TObject);
procedure actFirstPageExecute(Sender: TObject); procedure actFirstPageExecute(Sender: TObject);
@ -108,64 +103,57 @@ type
procedure SetCaptions; procedure SetCaptions;
public public
Resource : TVpResource; Resource: TVpResource;
Contact : TVpContact; Contact: TVpContact;
ReturnCode : TVpEditorReturnCode; ReturnCode: TVpEditorReturnCode;
end; end;
TVpPrintPreviewDialog = class (TVpBaseDialog) TVpPrintPreviewDialog = class (TVpBaseDialog)
private private
FControlLink : TVpControlLink; FControlLink: TVpControlLink;
FAutoPrint : Boolean; FAutoPrint: Boolean;
FBottomMargin : Extended; FBottomMargin: Extended;
FEndDate : TDateTime; FEndDate: TDateTime;
FLeftMargin : Extended; FLeftMargin: Extended;
FMarginUnits : TVpItemMeasurement; FMarginUnits: TVpItemMeasurement;
FRightMargin : Extended; FRightMargin: Extended;
FStartDate : TDateTime; FStartDate: TDateTime;
FTopMargin : Extended; FTopMargin: Extended;
FZoomFactor : TVpPPZoomFactor; FZoomFactor: TVpPPZoomFactor;
FWindowState : TWindowState; FWindowState: TWindowState;
FPrinter : TPrinter; FPrinter: TPrinter;
protected protected
procedure Notification (AComponent : TComponent; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
Operation : TOperation); override; procedure SetAutoPrint(const v: Boolean);
procedure SetAutoPrint (const v : Boolean); procedure SetBottomMargin(const v: Extended);
procedure SetBottomMargin (const v : Extended); procedure SetControlLink(const v: TVpControlLink);
procedure SetControlLink (const v : TVpControlLink); procedure SetEndDate(const v: TDateTime);
procedure SetEndDate (const v : TDateTime); procedure SetLeftMargin(const v: Extended);
procedure SetLeftMargin (const v : Extended); procedure SetMarginUnits(const v: TVpItemMeasurement);
procedure SetMarginUnits (const v : TVpItemMeasurement); procedure SetRightMargin(const v: Extended);
procedure SetRightMargin (const v : Extended); procedure SetStartDate(const v: TDateTime);
procedure SetStartDate (const v : TDateTime); procedure SetTopMargin(const v: Extended);
procedure SetTopMargin (const v : Extended); procedure SetZoomFactor(const v: TVpPPZoomFactor);
procedure SetZoomFactor (const v : TVpPPZoomFactor);
public public
constructor Create (AOwner : TComponent); override; constructor Create(AOwner: TComponent); override;
function Execute : Boolean; override; function Execute: Boolean; override;
property Printer : TPrinter read FPrinter write FPrinter; property Printer: TPrinter read FPrinter write FPrinter;
published published
property AutoPrint : Boolean read FAutoPrint write SetAutoPrint property AutoPrint: Boolean read FAutoPrint write SetAutoPrint default False;
default False; property BottomMargin: Extended read FBottomMargin write SetBottomMargin;
property BottomMargin : Extended property ControlLink: TVpControlLink read FControlLink write SetControlLink;
read FBottomMargin write SetBottomMargin; property EndDate: TDateTime read FEndDate write SetEndDate;
property ControlLink : TVpControlLink property LeftMargin: Extended read FLeftMargin write SetLeftMargin;
read FControlLink write SetControlLink; property MarginUnits: TVpItemMeasurement read FMarginUnits write SetMarginUnits default imInches;
property EndDate : TDateTime read FEndDate write SetEndDate; property RightMargin: Extended read FRightMargin write SetRightMargin;
property LeftMargin : Extended read FLeftMargin write SetLeftMargin; property StartDate: TDateTime read FStartDate write SetStartDate;
property MarginUnits : TVpItemMeasurement property TopMargin: Extended read FTopMargin write SetTopMargin;
read FMarginUnits write SetMarginUnits default imInches; property WindowState: TWindowState read FWindowState write FWindowState default wsNormal;
property RightMargin : Extended read FRightMargin write SetRightMargin; property ZoomFactor: TVpPPZoomFactor read FZoomFactor write SetZoomFactor default zfFitToControl;
property StartDate : TDateTime read FStartDate write SetStartDate;
property TopMargin : Extended read FTopMargin write SetTopMargin;
property WindowState : TWindowState read FWindowState write FWindowState
default wsNormal;
property ZoomFactor : TVpPPZoomFactor
read FZoomFactor write SetZoomFactor default zfFitToControl;
property DataStore; property DataStore;
property Options; property Options;
@ -189,7 +177,18 @@ end;
procedure TfrmPrintPreview.SetCaptions; procedure TfrmPrintPreview.SetCaptions;
begin begin
Self.Caption := RSDlgPrintPreview; Self.Caption := RSDlgPrintPreview;
actCancel.Caption := RSCancelBtn; actPrint.Caption := RSPrintPrvPrint;
actPrint.Hint := RSPrintPrvPrintHint;
actFirstPage.Caption := RSPrintPrvFirstPage;
actFirstPage.Hint := RSPrintPrvFirstPageHint;
actPrevPage.Caption := RSPrintPrvPrevPage;
actPrevPage.Hint := RsPrintPrvPrevPageHint;
actNextPage.Caption := RSPrintPrvNextPage;
actNextPage.Hint := RSPrintPrvNextPageHint;
actLastPage.Caption := RSPrintPrvLastPage;
actLastPage.Hint := RSPrintPrvLastPageHint;
actCancel.Caption := RSPrintPrvCancel;
actCancel.Hint := RSPrintPrvCancelHint;
end; end;
@ -199,26 +198,26 @@ begin
Close; Close;
end; end;
constructor TVpPrintPreviewDialog.Create (AOwner : TComponent); constructor TVpPrintPreviewDialog.Create(AOwner: TComponent);
begin begin
inherited Create (AOwner); inherited Create (AOwner);
FPlacement.Height := 480; FPlacement.Height := 480;
FPlacement.Width := 640; FPlacement.Width := 640;
StartDate := Now; StartDate := Now;
EndDate := Now + 7; EndDate := Now + 7;
FZoomFactor := zfFitToControl; FZoomFactor := zfFitToControl;
FWindowState := wsNormal; FWindowState := wsNormal;
FAutoPrint := False; FAutoPrint := False;
FControlLink := SearchControlLink (Owner); FControlLink := SearchControlLink(Owner);
FPrinter := Printer; FPrinter := Printer;
end; end;
function TVpPrintPreviewDialog.Execute : Boolean; function TVpPrintPreviewDialog.Execute: Boolean;
var var
EditForm : TfrmPrintPreview; EditForm: TfrmPrintPreview;
begin begin
Result := False; Result := False;
Application.CreateForm (TfrmPrintPreview, EditForm); Application.CreateForm(TfrmPrintPreview, EditForm);
try try
DoFormPlacement(EditForm); DoFormPlacement(EditForm);
EditForm.WindowState := WindowState; EditForm.WindowState := WindowState;
@ -234,10 +233,10 @@ begin
if EditForm.ReturnCode = rtCommit then begin if EditForm.ReturnCode = rtCommit then begin
Result := True; Result := True;
end; end;
if AutoPrint and Assigned (FControlLink) and Result then begin if AutoPrint and Assigned(FControlLink) and Result then begin
Printer.BeginDoc; Printer.BeginDoc;
try try
FControlLink.Printer.Print (Printer, StartDate, EndDate); FControlLink.Printer.Print(Printer, StartDate, EndDate);
finally finally
Printer.EndDoc; Printer.EndDoc;
end; end;
@ -247,18 +246,19 @@ begin
end; end;
end; end;
procedure TVpPrintPreviewDialog.Notification (AComponent : TComponent; { Handle new/deleted components}
Operation : TOperation); procedure TVpPrintPreviewDialog.Notification(AComponent: TComponent;
{-Handle new/deleted components} Operation : TOperation);
begin begin
inherited Notification (AComponent, Operation); inherited Notification(AComponent, Operation);
if Operation = opRemove then begin if Operation = opRemove then begin
{Owned components going away} {Owned components going away}
if AComponent = FControlLink then begin if AComponent = FControlLink then begin
FControlLink := nil; FControlLink := nil;
end; end;
end else if Operation = opInsert then begin end else
if Operation = opInsert then begin
if AComponent is TVpControlLink then begin if AComponent is TVpControlLink then begin
if not Assigned (FControlLink) then begin if not Assigned (FControlLink) then begin
FControlLink := TVpControlLink (AComponent); FControlLink := TVpControlLink (AComponent);
@ -267,87 +267,66 @@ begin
end; end;
end; end;
procedure TVpPrintPreviewDialog.SetAutoPrint (const v : Boolean); procedure TVpPrintPreviewDialog.SetAutoPrint(const v: Boolean);
begin begin
if v <> FAutoPrint then if v <> FAutoPrint then
FAutoPrint := v; FAutoPrint := v;
end; end;
procedure TVpPrintPreviewDialog.SetBottomMargin (const v : Extended); procedure TVpPrintPreviewDialog.SetBottomMargin(const v: Extended);
begin begin
if v <> FBottomMargin then if v <> FBottomMargin then
FBottomMargin := v; FBottomMargin := v;
end; end;
procedure TVpPrintPreviewDialog.SetControlLink (const v : TVpControlLink); procedure TVpPrintPreviewDialog.SetControlLink(const v: TVpControlLink);
begin begin
if FControlLink <> v then if FControlLink <> v then
FControlLink := v; FControlLink := v;
end; end;
procedure TVpPrintPreviewDialog.SetEndDate (const v : TDateTime); procedure TVpPrintPreviewDialog.SetEndDate(const v: TDateTime);
begin begin
if v <> FEndDate then if v <> FEndDate then
FEndDate := v; FEndDate := v;
end; end;
procedure TVpPrintPreviewDialog.SetLeftMargin (const v : Extended); procedure TVpPrintPreviewDialog.SetLeftMargin(const v: Extended);
begin begin
if v <> FLeftMargin then if v <> FLeftMargin then
FLeftMargin := v; FLeftMargin := v;
end; end;
procedure TVpPrintPreviewDialog.SetMarginUnits (const v : TVpItemMeasurement); procedure TVpPrintPreviewDialog.SetMarginUnits(const v: TVpItemMeasurement);
begin begin
if v <> FMarginUnits then if v <> FMarginUnits then
FMarginUnits := v; FMarginUnits := v;
end; end;
procedure TVpPrintPreviewDialog.SetRightMargin (const v : Extended); procedure TVpPrintPreviewDialog.SetRightMargin(const v: Extended);
begin begin
if v <> FRightMargin then if v <> FRightMargin then
FRightMargin := v; FRightMargin := v;
end; end;
procedure TVpPrintPreviewDialog.SetStartDate (const v : TDateTime); procedure TVpPrintPreviewDialog.SetStartDate(const v: TDateTime);
begin begin
if v <> FStartDate then if v <> FStartDate then
FStartDate := v; FStartDate := v;
end; end;
procedure TVpPrintPreviewDialog.SetTopMargin (const v : Extended); procedure TVpPrintPreviewDialog.SetTopMargin(const v: Extended);
begin begin
if v <> FTopMargin then if v <> FTopMargin then
FTopMargin := v; FTopMargin := v;
end; end;
procedure TVpPrintPreviewDialog.SetZoomFactor (const v : TVpPPZoomFactor); procedure TVpPrintPreviewDialog.SetZoomFactor(const v: TVpPPZoomFactor);
begin begin
if v <> FZoomFactor then if v <> FZoomFactor then
FZoomFactor := v; FZoomFactor := v;
end; end;
{ TfrmPrintPreview }
procedure TfrmPrintPreview.btnFirstPageClick(Sender: TObject);
begin
VpPrintPreview1.FirstPage;
end;
procedure TfrmPrintPreview.btnPrevPageClick(Sender: TObject);
begin
VpPrintPreview1.PrevPage;
end;
procedure TfrmPrintPreview.btnNextPageClick(Sender: TObject);
begin
VpPrintPreview1.NextPage;
end;
procedure TfrmPrintPreview.btnLastPageClick(Sender: TObject);
begin
VpPrintPreview1.LastPage;
end;
procedure TfrmPrintPreview.cboxZoomChange(Sender: TObject); procedure TfrmPrintPreview.cboxZoomChange(Sender: TObject);
begin begin
VpPrintPreview1.ZoomFactor := TVpPPZoomFactor(cboxZoom.ItemIndex); VpPrintPreview1.ZoomFactor := TVpPPZoomFactor(cboxZoom.ItemIndex);

View File

@ -167,10 +167,18 @@ resourcestring
RSWeekPopupNavPrevYear = 'Previous Year'; RSWeekPopupNavPrevYear = 'Previous Year';
{ Print Preview Specific } { Print Preview Specific }
RSPrintPrvPrevPage = 'Previous Page'; RSPrintPrvPrint = '&Print';
RSPrintPrvNextPage = 'Next Page'; RSPrintPrvPrintHint = 'Print';
RSPrintPrvFirstPage = 'First Page'; RSPrintPrvPrevPage = 'Pre&vious page';
RSPrintPrvLastPage = 'Last Page'; RSPrintPrvNextPage = '&Next page';
RSPrintPrvFirstPage = '&First page';
RSPrintPrvLastPage = '&Last page';
RSPrintPrvFirstPageHint = 'Go to first page';
RSPrintPrvPrevPageHint = 'Go to previous page';
RSPrintPrvNextPageHint = 'Go to next page';
RSPrintPrvLastPageHint = 'Go to last page';
RSPrintPrvCancel = 'Cancel';
RSPrintPrvCancelHint = 'Cancel preview';
{ DayView Specific } { DayView Specific }
RSDayPopupAdd = 'Add Event...'; RSDayPopupAdd = 'Add Event...';