GridPrinter: More options to control the preview's toolbar.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8609 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-11-11 22:59:52 +00:00
parent 8bd3387381
commit 1fe764c55e
12 changed files with 1089 additions and 480 deletions

View File

@ -15,12 +15,12 @@ object MainForm: TMainForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnPrint AnchorSideBottom.Control = btnPrint
Left = 6 Left = 8
Height = 419 Height = 411
Top = 35 Top = 39
Width = 644 Width = 640
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 8
ColCount = 6 ColCount = 6
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSizing, goColSizing, goEditing, goThumbTracking, goSmoothScroll, goCellEllipsis] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSizing, goColSizing, goEditing, goThumbTracking, goSmoothScroll, goCellEllipsis]
RowCount = 6 RowCount = 6
@ -30,13 +30,13 @@ object MainForm: TMainForm
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 8
Height = 25 Height = 25
Top = 460 Top = 458
Width = 60 Width = 60
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 8
Caption = 'Print...' Caption = 'Print...'
OnClick = btnPrintClick OnClick = btnPrintClick
TabOrder = 1 TabOrder = 1
@ -45,9 +45,9 @@ object MainForm: TMainForm
AnchorSideLeft.Control = cmbDialogs AnchorSideLeft.Control = cmbDialogs
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnPrint AnchorSideTop.Control = btnPrint
Left = 260 Left = 264
Height = 25 Height = 25
Top = 460 Top = 458
Width = 76 Width = 76
AutoSize = True AutoSize = True
BorderSpacing.Left = 24 BorderSpacing.Left = 24
@ -60,11 +60,11 @@ object MainForm: TMainForm
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnPrint AnchorSideTop.Control = btnPrint
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 72 Left = 76
Height = 23 Height = 23
Top = 461 Top = 459
Width = 164 Width = 164
BorderSpacing.Left = 6 DropDownCount = 24
ItemHeight = 15 ItemHeight = 15
Items.Strings = ( Items.Strings = (
'RSNoPrinterDialog' 'RSNoPrinterDialog'
@ -82,12 +82,13 @@ object MainForm: TMainForm
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 342 Left = 348
Height = 22 Height = 22
Top = 461 Top = 459
Width = 308 Width = 300
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6 BorderSpacing.Around = 8
DropDownCount = 24
ItemHeight = 16 ItemHeight = 16
Items.Strings = ( Items.Strings = (
'ppoNavigationBtns' 'ppoNavigationBtns'
@ -97,30 +98,34 @@ object MainForm: TMainForm
'ppoMarginsBtn' 'ppoMarginsBtn'
'ppoHeaderFooterBtn' 'ppoHeaderFooterBtn'
'ppoPrintOrderBtns ' 'ppoPrintOrderBtns '
'ppoCenterBtns'
'ppoPageSetupBtn'
'ppoPageInfo'
'ppoZoomInfo'
) )
OnItemChange = ccbPreviewOptionsItemChange OnItemChange = ccbPreviewOptionsItemChange
TabOrder = 4 TabOrder = 4
end end
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 8
Height = 29 Height = 23
Top = 0 Top = 8
Width = 656 Width = 640
Align = alTop Align = alTop
AutoSize = True AutoSize = True
BorderSpacing.Around = 8
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 29 ClientHeight = 23
ClientWidth = 656 ClientWidth = 640
TabOrder = 5 TabOrder = 5
object Label1: TLabel object Label1: TLabel
AnchorSideLeft.Control = Panel1 AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = cmbLanguages AnchorSideTop.Control = cmbLanguages
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 0
Height = 15 Height = 15
Top = 10 Top = 4
Width = 55 Width = 55
BorderSpacing.Left = 6
Caption = 'Language:' Caption = 'Language:'
end end
object cmbLanguages: TComboBox object cmbLanguages: TComboBox
@ -129,14 +134,12 @@ object MainForm: TMainForm
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
AnchorSideRight.Control = Panel1 AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 67 Left = 61
Height = 23 Height = 23
Top = 6 Top = 0
Width = 581 Width = 579
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Right = 8
ItemHeight = 15 ItemHeight = 15
OnChange = cmbLanguagesChange OnChange = cmbLanguagesChange
Style = csDropDownList Style = csDropDownList

View File

@ -65,6 +65,10 @@ resourcestring
RSPageMarginsButtons = 'Page margins button'; RSPageMarginsButtons = 'Page margins button';
RSHeaderFooterButton = 'Header/footer button'; RSHeaderFooterButton = 'Header/footer button';
RSPrintOrderButtons = 'Print order: colums first or rows first'; RSPrintOrderButtons = 'Print order: colums first or rows first';
RSCenterButtons = 'Buttons for centering grid on page';
RSPageSetupButton = 'Page setup dropdown-menu';
RSPageNumberInfoPanel = 'Page number info';
RSZoomLevelInfoPanel = 'Zoom level info';
{ TMainForm } { TMainForm }
@ -92,6 +96,10 @@ begin
if ccbPreviewOptions.Checked[4] then Include(optns, ppoMarginsBtn); if ccbPreviewOptions.Checked[4] then Include(optns, ppoMarginsBtn);
if ccbPreviewOptions.Checked[5] then Include(optns, ppoHeaderFooterBtn); if ccbPreviewOptions.Checked[5] then Include(optns, ppoHeaderFooterBtn);
if ccbPreviewOptions.Checked[6] then Include(optns, ppoPrintOrderBtns); if ccbPreviewOptions.Checked[6] then Include(optns, ppoPrintOrderBtns);
if ccbPreviewOptions.Checked[7] then Include(optns, ppoCenterBtns);
if ccbPreviewOptions.Checked[8] then Include(optns, ppoPageSetupBtn);
if ccbPreviewOptions.Checked[9] then Include(optns, ppoPageNumberInfo);
if ccbPreviewOptions.Checked[10] then Include(optns, ppoZoomLevelInfo);
GridPrintPreviewDialog1.Options := optns; GridPrintPreviewDialog1.Options := optns;
end; end;
@ -110,7 +118,7 @@ begin
cmbDialogs.ItemIndex := 2; cmbDialogs.ItemIndex := 2;
ccbPreviewOptions.ItemIndex := 0; ccbPreviewOptions.ItemIndex := 0;
for i := 0 to ccbPreviewOptions.Count-1 do for i := 0 to ccbPreviewOptions.Count-1 do
ccbPreviewOptions.Checked[i] := true; ccbPreviewOptions.Checked[i] := TGridPrintPreviewOption(i) in DEFAULT_GRIDPRN_OPTIONS;
FLanguagesDir := ExpandFileName(Application.Location + '../../languages/'); FLanguagesDir := ExpandFileName(Application.Location + '../../languages/');
PopulateLanguages; PopulateLanguages;
@ -212,6 +220,10 @@ begin
ccbPreviewOptions.Items[4] := RSPageMarginsButtons; ccbPreviewOptions.Items[4] := RSPageMarginsButtons;
ccbPreviewOptions.Items[5] := RSHeaderFooterButton; ccbPreviewOptions.Items[5] := RSHeaderFooterButton;
ccbPreviewOptions.Items[6] := RSPrintOrderButtons; ccbPreviewOptions.Items[6] := RSPrintOrderButtons;
ccbPreviewOptions.Items[7] := RSCenterButtons;
ccbPreviewOptions.Items[8] := RSPageSetupButton;
ccbPreviewOptions.Items[9] := RSPageNumberInfoPanel;
ccbPreviewOptions.Items[10] := RSZoomLevelInfoPanel;
ccbPreviewOptions.ItemIndex := idx2; ccbPreviewOptions.ItemIndex := idx2;
end; end;

View File

@ -9,12 +9,30 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.1.1\n" "X-Generator: Poedit 3.2\n"
#: gridprnstrings.rsbottommargin #: gridprnstrings.rsbottommargin
msgid "Bottom margin" msgid "Bottom margin"
msgstr "Unterer Rand" msgstr "Unterer Rand"
#: gridprnstrings.rscenterhor
msgctxt "gridprnstrings.rscenterhor"
msgid "Center horizontally"
msgstr "Horizontal zentrieren"
#: gridprnstrings.rscenterhorhint
msgid "Center grid in page horizontally"
msgstr "Die Tabelle auf der Seite horizontal zentrieren"
#: gridprnstrings.rscentervert
msgctxt "gridprnstrings.rscentervert"
msgid "Center vertically"
msgstr "Vertikal zentrieren"
#: gridprnstrings.rscenterverthint
msgid "Center grid in page vertically"
msgstr "Die Tabelle auf der Seite vertikal zentrieren"
#: gridprnstrings.rsclose #: gridprnstrings.rsclose
msgid "Close" msgid "Close"
msgstr "Schließen" msgstr "Schließen"
@ -35,7 +53,13 @@ msgstr "Fußzeilen-Rand"
msgid "Header" msgid "Header"
msgstr "Kopfzeile" msgstr "Kopfzeile"
#: gridprnstrings.rsheaderfooterconfig #: gridprnstrings.rsheaderfooter
msgctxt "gridprnstrings.rsheaderfooter"
msgid "Header/footer..."
msgstr "Kopf-/Fußzeile"
#: gridprnstrings.rsheaderfooterhint
msgctxt "gridprnstrings.rsheaderfooterhint"
msgid "Header/footer configuration" msgid "Header/footer configuration"
msgstr "Kopf/Fußzeilen-Konfiguration" msgstr "Kopf/Fußzeilen-Konfiguration"
@ -63,7 +87,13 @@ msgstr ""
msgid "Header margin" msgid "Header margin"
msgstr "Kopfzeilen-Rand" msgstr "Kopfzeilen-Rand"
#: gridprnstrings.rslandscapepageorientation #: gridprnstrings.rslandscape
msgctxt "gridprnstrings.rslandscape"
msgid "Landscape"
msgstr "Querformat"
#: gridprnstrings.rslandscapehint
msgctxt "gridprnstrings.rslandscapehint"
msgid "Landscape page orientation" msgid "Landscape page orientation"
msgstr "Seite im Querformat" msgstr "Seite im Querformat"
@ -85,14 +115,42 @@ msgstr "Originalgröße (100%)"
#: gridprnstrings.rspageandzoominfo #: gridprnstrings.rspageandzoominfo
#, object-pascal-format #, object-pascal-format
msgid "Page %d of %d, Zoom %d %%" msgid "Page %0:d of %1:d, Zoom %2:d %%"
msgstr "Seite %d von %d, Skalierung %d %%" msgstr "Seite %d von %d, Skalierung %d %%"
#: gridprnstrings.rspageinfo
#, object-pascal-format
msgid "Page %0:d of %1:d"
msgstr "Seite %0:d von %1:d"
#: gridprnstrings.rspageinfopanel
msgid "Page numbers"
msgstr "Seitenzahlen"
#: gridprnstrings.rspagemargins
msgctxt "gridprnstrings.rspagemargins"
msgid "Margins"
msgstr "Seitenränder"
#: gridprnstrings.rspagemarginsconfig #: gridprnstrings.rspagemarginsconfig
msgid "Page margins configuration" msgid "Page margins configuration"
msgstr "Einstellung der Seitenränder" msgstr "Einstellung der Seitenränder"
#: gridprnstrings.rsportraitpageorientation #: gridprnstrings.rspagemarginshint
msgid "Page margins"
msgstr "Seitenränder"
#: gridprnstrings.rspagesetuphint
msgid "Page setup options"
msgstr "Seiteneinrichtungs-Optionen"
#: gridprnstrings.rsportrait
msgctxt "gridprnstrings.rsportrait"
msgid "Portrait"
msgstr "Hochformat"
#: gridprnstrings.rsportraithint
msgctxt "gridprnstrings.rsportraithint"
msgid "Portrait page orientation" msgid "Portrait page orientation"
msgstr "Seite im Hochformat" msgstr "Seite im Hochformat"
@ -101,6 +159,12 @@ msgid "Print"
msgstr "Drucken" msgstr "Drucken"
#: gridprnstrings.rsprintcolsfirst #: gridprnstrings.rsprintcolsfirst
msgctxt "gridprnstrings.rsprintcolsfirst"
msgid "Columns first"
msgstr "Spalten zuerst"
#: gridprnstrings.rsprintcolsfirsthint
msgctxt "gridprnstrings.rsprintcolsfirsthint"
msgid "" msgid ""
"First print columns from top to bottom,\n" "First print columns from top to bottom,\n"
"then print from left to right" "then print from left to right"
@ -126,6 +190,12 @@ msgid "Preview..."
msgstr "Druckvorschau..." msgstr "Druckvorschau..."
#: gridprnstrings.rsprintrowsfirst #: gridprnstrings.rsprintrowsfirst
msgctxt "gridprnstrings.rsprintrowsfirst"
msgid "Rows first"
msgstr "Zeilen zuerst"
#: gridprnstrings.rsprintrowsfirsthint
msgctxt "gridprnstrings.rsprintrowsfirsthint"
msgid "" msgid ""
"First print rows from left to right,\n" "First print rows from left to right,\n"
"then print from top to bottom" "then print from top to bottom"
@ -181,6 +251,15 @@ msgstr "Oberer Rand"
msgid "Zoom in" msgid "Zoom in"
msgstr "Vergrößern" msgstr "Vergrößern"
#: gridprnstrings.rszoominfo
#, object-pascal-format
msgid "Zoom %2:d %%"
msgstr "Skalierung %2:d %%"
#: gridprnstrings.rszoominfopanel
msgid "Zoom level"
msgstr "Skalierungsniveau"
#: gridprnstrings.rszoomout #: gridprnstrings.rszoomout
msgid "Zoom out" msgid "Zoom out"
msgstr "Verkleinern" msgstr "Verkleinern"

View File

@ -9,12 +9,30 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.1.1\n" "X-Generator: Poedit 3.2\n"
#: gridprnstrings.rsbottommargin #: gridprnstrings.rsbottommargin
msgid "Bottom margin" msgid "Bottom margin"
msgstr "Bottom margin" msgstr "Bottom margin"
#: gridprnstrings.rscenterhor
msgctxt "gridprnstrings.rscenterhor"
msgid "Center horizontally"
msgstr "Center horizontally"
#: gridprnstrings.rscenterhorhint
msgid "Center grid in page horizontally"
msgstr "Center grid in page horizontally"
#: gridprnstrings.rscentervert
msgctxt "gridprnstrings.rscentervert"
msgid "Center vertically"
msgstr "Center vertically"
#: gridprnstrings.rscenterverthint
msgid "Center grid in page vertically"
msgstr "Center grid in page vertically"
#: gridprnstrings.rsclose #: gridprnstrings.rsclose
msgid "Close" msgid "Close"
msgstr "Close" msgstr "Close"
@ -35,7 +53,13 @@ msgstr "Footer margin"
msgid "Header" msgid "Header"
msgstr "Header" msgstr "Header"
#: gridprnstrings.rsheaderfooterconfig #: gridprnstrings.rsheaderfooter
msgctxt "gridprnstrings.rsheaderfooter"
msgid "Header/footer..."
msgstr "Header/footer..."
#: gridprnstrings.rsheaderfooterhint
msgctxt "gridprnstrings.rsheaderfooterhint"
msgid "Header/footer configuration" msgid "Header/footer configuration"
msgstr "Header/footer configuration" msgstr "Header/footer configuration"
@ -63,7 +87,13 @@ msgstr ""
msgid "Header margin" msgid "Header margin"
msgstr "Header margin" msgstr "Header margin"
#: gridprnstrings.rslandscapepageorientation #: gridprnstrings.rslandscape
msgctxt "gridprnstrings.rslandscape"
msgid "Landscape"
msgstr "Landscape"
#: gridprnstrings.rslandscapehint
msgctxt "gridprnstrings.rslandscapehint"
msgid "Landscape page orientation" msgid "Landscape page orientation"
msgstr "Landscape page orientation" msgstr "Landscape page orientation"
@ -85,14 +115,43 @@ msgstr "Original size (100%)"
#: gridprnstrings.rspageandzoominfo #: gridprnstrings.rspageandzoominfo
#, object-pascal-format #, object-pascal-format
msgid "Page %d of %d, Zoom %d %%" #| msgid "Page %d of %d, Zoom %d %%"
msgstr "Page %d of %d, Zoom %d %%" msgid "Page %0:d of %1:d, Zoom %2:d %%"
msgstr "Page %0:d of %1:d, Zoom %2:d %%"
#: gridprnstrings.rspageinfo
#, object-pascal-format
msgid "Page %0:d of %1:d"
msgstr "Page %0:d of %1:d"
#: gridprnstrings.rspageinfopanel
msgid "Page numbers"
msgstr "Page numbers"
#: gridprnstrings.rspagemargins
msgctxt "gridprnstrings.rspagemargins"
msgid "Margins"
msgstr "Margins"
#: gridprnstrings.rspagemarginsconfig #: gridprnstrings.rspagemarginsconfig
msgid "Page margins configuration" msgid "Page margins configuration"
msgstr "Page margins configuration" msgstr "Page margins configuration"
#: gridprnstrings.rsportraitpageorientation #: gridprnstrings.rspagemarginshint
msgid "Page margins"
msgstr "Page margins"
#: gridprnstrings.rspagesetuphint
msgid "Page setup options"
msgstr "Page setup options"
#: gridprnstrings.rsportrait
msgctxt "gridprnstrings.rsportrait"
msgid "Portrait"
msgstr "Portrait"
#: gridprnstrings.rsportraithint
msgctxt "gridprnstrings.rsportraithint"
msgid "Portrait page orientation" msgid "Portrait page orientation"
msgstr "Portrait page orientation" msgstr "Portrait page orientation"
@ -101,6 +160,12 @@ msgid "Print"
msgstr "Print" msgstr "Print"
#: gridprnstrings.rsprintcolsfirst #: gridprnstrings.rsprintcolsfirst
msgctxt "gridprnstrings.rsprintcolsfirst"
msgid "Columns first"
msgstr "Columns first"
#: gridprnstrings.rsprintcolsfirsthint
msgctxt "gridprnstrings.rsprintcolsfirsthint"
msgid "" msgid ""
"First print columns from top to bottom,\n" "First print columns from top to bottom,\n"
"then print from left to right" "then print from left to right"
@ -126,6 +191,12 @@ msgid "Preview..."
msgstr "Preview..." msgstr "Preview..."
#: gridprnstrings.rsprintrowsfirst #: gridprnstrings.rsprintrowsfirst
msgctxt "gridprnstrings.rsprintrowsfirst"
msgid "Rows first"
msgstr "Rows first"
#: gridprnstrings.rsprintrowsfirsthint
msgctxt "gridprnstrings.rsprintrowsfirsthint"
msgid "" msgid ""
"First print rows from left to right,\n" "First print rows from left to right,\n"
"then print from top to bottom" "then print from top to bottom"
@ -181,6 +252,15 @@ msgstr "Top margin"
msgid "Zoom in" msgid "Zoom in"
msgstr "Zoom in" msgstr "Zoom in"
#: gridprnstrings.rszoominfo
#, object-pascal-format
msgid "Zoom %2:d %%"
msgstr "Zoom %2:d %%"
#: gridprnstrings.rszoominfopanel
msgid "Zoom level"
msgstr "Zoom level"
#: gridprnstrings.rszoomout #: gridprnstrings.rszoomout
msgid "Zoom out" msgid "Zoom out"
msgstr "Zoom out" msgstr "Zoom out"

View File

@ -5,6 +5,24 @@ msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Bottom margin" msgid "Bottom margin"
msgstr "" msgstr ""
#: gridprnstrings.rscenterhor
msgctxt "gridprnstrings.rscenterhor"
msgid "Center horizontally"
msgstr ""
#: gridprnstrings.rscenterhorhint
msgid "Center grid in page horizontally"
msgstr ""
#: gridprnstrings.rscentervert
msgctxt "gridprnstrings.rscentervert"
msgid "Center vertically"
msgstr ""
#: gridprnstrings.rscenterverthint
msgid "Center grid in page vertically"
msgstr ""
#: gridprnstrings.rsclose #: gridprnstrings.rsclose
msgid "Close" msgid "Close"
msgstr "" msgstr ""
@ -25,7 +43,13 @@ msgstr ""
msgid "Header" msgid "Header"
msgstr "" msgstr ""
#: gridprnstrings.rsheaderfooterconfig #: gridprnstrings.rsheaderfooter
msgctxt "gridprnstrings.rsheaderfooter"
msgid "Header/footer..."
msgstr ""
#: gridprnstrings.rsheaderfooterhint
msgctxt "gridprnstrings.rsheaderfooterhint"
msgid "Header/footer configuration" msgid "Header/footer configuration"
msgstr "" msgstr ""
@ -45,7 +69,13 @@ msgstr ""
msgid "Header margin" msgid "Header margin"
msgstr "" msgstr ""
#: gridprnstrings.rslandscapepageorientation #: gridprnstrings.rslandscape
msgctxt "gridprnstrings.rslandscape"
msgid "Landscape"
msgstr ""
#: gridprnstrings.rslandscapehint
msgctxt "gridprnstrings.rslandscapehint"
msgid "Landscape page orientation" msgid "Landscape page orientation"
msgstr "" msgstr ""
@ -67,14 +97,42 @@ msgstr ""
#: gridprnstrings.rspageandzoominfo #: gridprnstrings.rspageandzoominfo
#, object-pascal-format #, object-pascal-format
msgid "Page %d of %d, Zoom %d %%" msgid "Page %0:d of %1:d, Zoom %2:d %%"
msgstr ""
#: gridprnstrings.rspageinfo
#, object-pascal-format
msgid "Page %0:d of %1:d"
msgstr ""
#: gridprnstrings.rspageinfopanel
msgid "Page numbers"
msgstr ""
#: gridprnstrings.rspagemargins
msgctxt "gridprnstrings.rspagemargins"
msgid "Margins"
msgstr "" msgstr ""
#: gridprnstrings.rspagemarginsconfig #: gridprnstrings.rspagemarginsconfig
msgid "Page margins configuration" msgid "Page margins configuration"
msgstr "" msgstr ""
#: gridprnstrings.rsportraitpageorientation #: gridprnstrings.rspagemarginshint
msgid "Page margins"
msgstr ""
#: gridprnstrings.rspagesetuphint
msgid "Page setup options"
msgstr ""
#: gridprnstrings.rsportrait
msgctxt "gridprnstrings.rsportrait"
msgid "Portrait"
msgstr ""
#: gridprnstrings.rsportraithint
msgctxt "gridprnstrings.rsportraithint"
msgid "Portrait page orientation" msgid "Portrait page orientation"
msgstr "" msgstr ""
@ -83,6 +141,12 @@ msgid "Print"
msgstr "" msgstr ""
#: gridprnstrings.rsprintcolsfirst #: gridprnstrings.rsprintcolsfirst
msgctxt "gridprnstrings.rsprintcolsfirst"
msgid "Columns first"
msgstr ""
#: gridprnstrings.rsprintcolsfirsthint
msgctxt "gridprnstrings.rsprintcolsfirsthint"
msgid "" msgid ""
"First print columns from top to bottom,\n" "First print columns from top to bottom,\n"
"then print from left to right" "then print from left to right"
@ -106,6 +170,12 @@ msgid "Preview..."
msgstr "" msgstr ""
#: gridprnstrings.rsprintrowsfirst #: gridprnstrings.rsprintrowsfirst
msgctxt "gridprnstrings.rsprintrowsfirst"
msgid "Rows first"
msgstr ""
#: gridprnstrings.rsprintrowsfirsthint
msgctxt "gridprnstrings.rsprintrowsfirsthint"
msgid "" msgid ""
"First print rows from left to right,\n" "First print rows from left to right,\n"
"then print from top to bottom" "then print from top to bottom"
@ -159,6 +229,15 @@ msgstr ""
msgid "Zoom in" msgid "Zoom in"
msgstr "" msgstr ""
#: gridprnstrings.rszoominfo
#, object-pascal-format
msgid "Zoom %2:d %%"
msgstr ""
#: gridprnstrings.rszoominfopanel
msgid "Zoom level"
msgstr ""
#: gridprnstrings.rszoomout #: gridprnstrings.rszoomout
msgid "Zoom out" msgid "Zoom out"
msgstr "" msgstr ""

View File

@ -9,7 +9,11 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.1.1\n" "X-Generator: Poedit 3.2\n"
#: main.rscenterbuttons
msgid "Buttons for centering grid on page"
msgstr "Schalter zum Zentrieren der Tabelle auf der Seite"
#: main.rsheaderfooterbutton #: main.rsheaderfooterbutton
msgid "Header/footer button" msgid "Header/footer button"
@ -31,10 +35,19 @@ msgstr "Kein Dialog"
msgid "Page margins button" msgid "Page margins button"
msgstr "Schalter für Seitenränder" msgstr "Schalter für Seitenränder"
#: main.rspagenumberinfopanel
msgid "Page number info"
msgstr "Seitennummer-Information"
#: main.rspageorientationbuttons #: main.rspageorientationbuttons
msgid "Page orientation buttons" msgid "Page orientation buttons"
msgstr "Schalter für Seitenausrichtung" msgstr "Schalter für Seitenausrichtung"
#: main.rspagesetupbutton
msgctxt "main.rspagesetupbutton"
msgid "Page setup dropdown-menu"
msgstr "Seiteneinrichtungs-Menü"
#: main.rspagesetupdialog #: main.rspagesetupdialog
msgid "Page setup dialog" msgid "Page setup dialog"
msgstr "Seiteneinrichtungsdialog" msgstr "Seiteneinrichtungsdialog"
@ -55,6 +68,10 @@ msgstr "Druckreihenfolge: Spalten oder Zeilen zuerst"
msgid "Zoom buttons" msgid "Zoom buttons"
msgstr "Schalter für Vergrößerung" msgstr "Schalter für Vergrößerung"
#: main.rszoomlevelinfopanel
msgid "Zoom level info"
msgstr "Skalierungs-Information"
#: tmainform.btnpreview.caption #: tmainform.btnpreview.caption
msgid "Preview..." msgid "Preview..."
msgstr "Druckvorschau..." msgstr "Druckvorschau..."

View File

@ -9,7 +9,11 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.1.1\n" "X-Generator: Poedit 3.2\n"
#: main.rscenterbuttons
msgid "Buttons for centering grid on page"
msgstr "Buttons for centering grid on page"
#: main.rsheaderfooterbutton #: main.rsheaderfooterbutton
msgid "Header/footer button" msgid "Header/footer button"
@ -31,10 +35,19 @@ msgstr "No printer dialog"
msgid "Page margins button" msgid "Page margins button"
msgstr "Page margins button" msgstr "Page margins button"
#: main.rspagenumberinfopanel
msgid "Page number info"
msgstr "Page number info"
#: main.rspageorientationbuttons #: main.rspageorientationbuttons
msgid "Page orientation buttons" msgid "Page orientation buttons"
msgstr "Page orientation buttons" msgstr "Page orientation buttons"
#: main.rspagesetupbutton
msgctxt "main.rspagesetupbutton"
msgid "Page setup dropdown-menu"
msgstr "Page setup dropdown-menu"
#: main.rspagesetupdialog #: main.rspagesetupdialog
msgid "Page setup dialog" msgid "Page setup dialog"
msgstr "Page setup dialog" msgstr "Page setup dialog"
@ -55,6 +68,10 @@ msgstr "Print order: colums first or rows first"
msgid "Zoom buttons" msgid "Zoom buttons"
msgstr "Zoom buttons" msgstr "Zoom buttons"
#: main.rszoomlevelinfopanel
msgid "Zoom level info"
msgstr "Zoom level info"
#: tmainform.btnpreview.caption #: tmainform.btnpreview.caption
msgid "Preview..." msgid "Preview..."
msgstr "Preview..." msgstr "Preview..."

View File

@ -1,6 +1,10 @@
msgid "" msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8" msgstr "Content-Type: text/plain; charset=UTF-8"
#: main.rscenterbuttons
msgid "Buttons for centering grid on page"
msgstr ""
#: main.rsheaderfooterbutton #: main.rsheaderfooterbutton
msgid "Header/footer button" msgid "Header/footer button"
msgstr "" msgstr ""
@ -21,10 +25,19 @@ msgstr ""
msgid "Page margins button" msgid "Page margins button"
msgstr "" msgstr ""
#: main.rspagenumberinfopanel
msgid "Page number info"
msgstr ""
#: main.rspageorientationbuttons #: main.rspageorientationbuttons
msgid "Page orientation buttons" msgid "Page orientation buttons"
msgstr "" msgstr ""
#: main.rspagesetupbutton
msgctxt "main.rspagesetupbutton"
msgid "Page setup dropdown-menu"
msgstr ""
#: main.rspagesetupdialog #: main.rspagesetupdialog
msgid "Page setup dialog" msgid "Page setup dialog"
msgstr "" msgstr ""
@ -45,6 +58,10 @@ msgstr ""
msgid "Zoom buttons" msgid "Zoom buttons"
msgstr "" msgstr ""
#: main.rszoomlevelinfopanel
msgid "Zoom level info"
msgstr ""
#: tmainform.btnpreview.caption #: tmainform.btnpreview.caption
msgid "Preview..." msgid "Preview..."
msgstr "" msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -4,41 +4,10 @@
{"hash":13109985,"name":"tgridprintpreviewform.tbdivider1.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,49],"value":"tbDivider1"}, {"hash":13109985,"name":"tgridprintpreviewform.tbdivider1.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,49],"value":"tbDivider1"},
{"hash":13109986,"name":"tgridprintpreviewform.tbdivider2.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,50],"value":"tbDivider2"}, {"hash":13109986,"name":"tgridprintpreviewform.tbdivider2.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,50],"value":"tbDivider2"},
{"hash":13109987,"name":"tgridprintpreviewform.tbdivider3.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,51],"value":"tbDivider3"}, {"hash":13109987,"name":"tgridprintpreviewform.tbdivider3.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,51],"value":"tbDivider3"},
{"hash":14901026,"name":"tgridprintpreviewform.edpagenumber.text","sourcebytes":[101,100,80,97,103,101,78,117,109,98,101,114],"value":"edPageNumber"},
{"hash":13109988,"name":"tgridprintpreviewform.tbdivider4.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,52],"value":"tbDivider4"}, {"hash":13109988,"name":"tgridprintpreviewform.tbdivider4.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,52],"value":"tbDivider4"},
{"hash":13109989,"name":"tgridprintpreviewform.tbdivider5.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,53],"value":"tbDivider5"}, {"hash":13109989,"name":"tgridprintpreviewform.tbdivider5.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,53],"value":"tbDivider5"},
{"hash":5738580,"name":"tgridprintpreviewform.acprint.caption","sourcebytes":[80,114,105,110,116],"value":"Print"}, {"hash":231980464,"name":"tgridprintpreviewform.tbpagesetup.caption","sourcebytes":[116,98,80,97,103,101,83,101,116,117,112],"value":"tbPageSetup"},
{"hash":5738580,"name":"tgridprintpreviewform.acprint.hint","sourcebytes":[80,114,105,110,116],"value":"Print"}, {"hash":13109990,"name":"tgridprintpreviewform.tbdivider6.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,54],"value":"tbDivider6"},
{"hash":4863637,"name":"tgridprintpreviewform.acclose.caption","sourcebytes":[67,108,111,115,101],"value":"Close"}, {"hash":13109991,"name":"tgridprintpreviewform.tbdivider7.caption","sourcebytes":[116,98,68,105,118,105,100,101,114,55],"value":"tbDivider7"},
{"hash":4863637,"name":"tgridprintpreviewform.acclose.hint","sourcebytes":[67,108,111,115,101],"value":"Close"}, {"hash":14901026,"name":"tgridprintpreviewform.edpagenumber.text","sourcebytes":[101,100,80,97,103,101,78,117,109,98,101,114],"value":"edPageNumber"}
{"hash":5048740,"name":"tgridprintpreviewform.acfirstpage.caption","sourcebytes":[70,105,114,115,116],"value":"First"},
{"hash":217173685,"name":"tgridprintpreviewform.acfirstpage.hint","sourcebytes":[83,104,111,119,32,102,105,114,115,116,32,112,97,103,101],"value":"Show first page"},
{"hash":147653555,"name":"tgridprintpreviewform.acprevpage.caption","sourcebytes":[80,114,101,118,105,111,117,115],"value":"Previous"},
{"hash":239386821,"name":"tgridprintpreviewform.acprevpage.hint","sourcebytes":[83,104,111,119,32,112,114,101,118,105,111,117,115,32,112,97,103,101],"value":"Show previous page"},
{"hash":347380,"name":"tgridprintpreviewform.acnextpage.caption","sourcebytes":[78,101,120,116],"value":"Next"},
{"hash":923269,"name":"tgridprintpreviewform.acnextpage.hint","sourcebytes":[83,104,111,119,32,110,101,120,116,32,112,97,103,101],"value":"Show next page"},
{"hash":338084,"name":"tgridprintpreviewform.aclastpage.caption","sourcebytes":[76,97,115,116],"value":"Last"},
{"hash":84807877,"name":"tgridprintpreviewform.aclastpage.hint","sourcebytes":[83,104,111,119,32,108,97,115,116,32,112,97,103,101],"value":"Show last page"},
{"hash":23459486,"name":"tgridprintpreviewform.aczoomin.caption","sourcebytes":[90,111,111,109,32,105,110],"value":"Zoom in"},
{"hash":23459486,"name":"tgridprintpreviewform.aczoomin.hint","sourcebytes":[90,111,111,109,32,105,110],"value":"Zoom in"},
{"hash":106918100,"name":"tgridprintpreviewform.aczoomout.caption","sourcebytes":[90,111,111,109,32,111,117,116],"value":"Zoom out"},
{"hash":106918100,"name":"tgridprintpreviewform.aczoomout.hint","sourcebytes":[90,111,111,109,32,111,117,116],"value":"Zoom out"},
{"hash":108902056,"name":"tgridprintpreviewform.aczoomtofitwidth.caption","sourcebytes":[70,105,116,32,119,105,100,116,104],"value":"Fit width"},
{"hash":28176728,"name":"tgridprintpreviewform.aczoomtofitwidth.hint","sourcebytes":[90,111,111,109,32,116,111,32,102,105,116,32,119,105,100,116,104],"value":"Zoom to fit width"},
{"hash":116338068,"name":"tgridprintpreviewform.aczoomtofitheight.caption","sourcebytes":[70,105,116,32,104,101,105,103,104,116],"value":"Fit height"},
{"hash":122522228,"name":"tgridprintpreviewform.aczoomtofitheight.hint","sourcebytes":[90,111,111,109,32,116,111,32,102,105,116,32,112,97,103,101,32,104,101,105,103,104,116],"value":"Zoom to fit page height"},
{"hash":213797,"name":"tgridprintpreviewform.aczoom100.caption","sourcebytes":[49,48,48,37],"value":"100%"},
{"hash":23626005,"name":"tgridprintpreviewform.aczoom100.hint","sourcebytes":[79,114,105,103,105,110,97,108,32,115,105,122,101],"value":"Original size"},
{"hash":59301891,"name":"tgridprintpreviewform.acpagemargins.caption","sourcebytes":[77,97,114,103,105,110,115],"value":"Margins"},
{"hash":116328739,"name":"tgridprintpreviewform.acpagemargins.hint","sourcebytes":[80,97,103,101,32,109,97,114,103,105,110,115],"value":"Page margins"},
{"hash":208537918,"name":"tgridprintpreviewform.acheaderfooter.caption","sourcebytes":[72,101,97,100,101,114,47,102,111,111,116,101,114,46,46,46],"value":"Header/footer..."},
{"hash":120242270,"name":"tgridprintpreviewform.acheaderfooter.hint","sourcebytes":[72,101,97,100,101,114,47,102,111,111,116,101,114,32,99,111,110,102,105,103,117,114,97,116,105,111,110],"value":"Header/footer configuration"},
{"hash":110855028,"name":"tgridprintpreviewform.acportrait.caption","sourcebytes":[80,111,114,116,114,97,105,116],"value":"Portrait"},
{"hash":97583166,"name":"tgridprintpreviewform.acportrait.hint","sourcebytes":[80,111,114,116,114,97,105,116,32,112,97,103,101,32,111,114,105,101,110,116,97,116,105,111,110],"value":"Portrait page orientation"},
{"hash":79284965,"name":"tgridprintpreviewform.aclandscape.caption","sourcebytes":[76,97,110,100,115,99,97,112,101],"value":"Landscape"},
{"hash":214097038,"name":"tgridprintpreviewform.aclandscape.hint","sourcebytes":[76,97,110,100,115,99,97,112,101,32,112,97,103,101,32,111,114,105,101,110,116,97,116,105,111,110],"value":"Landscape page orientation"},
{"hash":252759476,"name":"tgridprintpreviewform.acprintcolsfirst.caption","sourcebytes":[67,111,108,117,109,110,115,32,102,105,114,115,116],"value":"Columns first"},
{"hash":179142132,"name":"tgridprintpreviewform.acprintcolsfirst.hint","sourcebytes":[70,105,114,115,116,32,112,114,105,110,116,32,99,111,108,117,109,110,115,32,102,114,111,109,32,116,111,112,32,116,111,32,98,111,116,116,111,109,44,13,10,116,104,101,110,32,112,114,105,110,116,32,102,114,111,109,32,108,101,102,116,32,116,111,32,114,105,103,104,116],"value":"First print columns from top to bottom,\r\nthen print from left to right"},
{"hash":90873668,"name":"tgridprintpreviewform.acprintrowsfirst.caption","sourcebytes":[82,111,119,115,32,102,105,114,115,116],"value":"Rows first"},
{"hash":159637965,"name":"tgridprintpreviewform.acprintrowsfirst.hint","sourcebytes":[70,105,114,115,116,32,112,114,105,110,116,32,114,111,119,115,32,102,114,111,109,32,108,101,102,116,32,116,111,32,114,105,103,104,116,44,13,10,116,104,101,110,32,112,114,105,110,116,32,102,114,111,109,32,116,111,112,32,116,111,32,98,111,116,116,111,109],"value":"First print rows from left to right,\r\nthen print from top to bottom"}
]} ]}

View File

@ -13,16 +13,24 @@ type
TGridPrintPreviewZoomMode = (zmCustom, zmFitWidth, zmFitHeight); TGridPrintPreviewZoomMode = (zmCustom, zmFitWidth, zmFitHeight);
TGridPrintPreviewOption = (ppoNavigationBtns, ppoNavigationEdit, TGridPrintPreviewOption = (ppoNavigationBtns, ppoNavigationEdit,
ppoZoomBtns, ppoPageOrientationBtns, ppoMarginsBtn, ppoHeaderFooterBtn, ppoZoomBtns,
ppoPrintOrderBtns ppoPageOrientationBtns, ppoMarginsBtn, ppoHeaderFooterBtn,
ppoPrintOrderBtns, ppoCenterBtns,
ppoPageSetupBtn,
ppoPageNumberInfo,
ppoZoomLevelInfo
); );
TGridPrintPreviewOptions = set of TGridPrintPreviewOption; TGridPrintPreviewOptions = set of TGridPrintPreviewOption;
const const
DEFAULT_GRIDPRN_OPTIONS = [ DEFAULT_GRIDPRN_OPTIONS = [
ppoNavigationBtns, ppoNavigationEdit, ppoNavigationBtns, ppoNavigationEdit,
ppoZoomBtns, ppoPageOrientationBtns, ppoMarginsBtn, ppoHeaderFooterBtn, ppoZoomBtns,
ppoPrintOrderBtns // ppoPageOrientationBtns, ppoMarginsBtn, ppoHeaderFooterBtn,
// ppoPrintOrderBtns, ppoCenterBtns,
ppoPageSetupBtn,
ppoPageNumberInfo,
ppoZoomLevelInfo
]; ];
type type
@ -41,6 +49,8 @@ type
acLandscape: TAction; acLandscape: TAction;
acPrintColsFirst: TAction; acPrintColsFirst: TAction;
acPrintRowsFirst: TAction; acPrintRowsFirst: TAction;
acCenterHor: TAction;
acCenterVert: TAction;
acZoom100: TAction; acZoom100: TAction;
acZoomToFitWidth: TAction; acZoomToFitWidth: TAction;
acZoomToFitHeight: TAction; acZoomToFitHeight: TAction;
@ -49,8 +59,21 @@ type
ActionList: TActionList; ActionList: TActionList;
edPageNumber: TEdit; edPageNumber: TEdit;
InfoPanel: TPanel; InfoPanel: TPanel;
mnuHeaderFooter: TMenuItem;
mnuPageMargins: TMenuItem;
mnuLandscape: TMenuItem;
mnuPortrait: TMenuItem;
mnuPrintColsFirst: TMenuItem;
mnuPrintRowsFirst: TMenuItem;
mnuCenterHor: TMenuItem;
mnuCenterVert: TMenuItem;
PageSetupPopup: TPopupMenu;
PageNoEditPanel: TPanel;
PreviewImage: TImage; PreviewImage: TImage;
ScrollBox: TScrollBox; ScrollBox: TScrollBox;
mnuSeparator3: TMenuItem;
mnuSeparator2: TMenuItem;
mnuSeparator1: TMenuItem;
ToolbarImages: TImageList; ToolbarImages: TImageList;
ToolBar: TToolBar; ToolBar: TToolBar;
tbPrint: TToolButton; tbPrint: TToolButton;
@ -67,14 +90,21 @@ type
tbZoomWidth: TToolButton; tbZoomWidth: TToolButton;
tbZoomHeight: TToolButton; tbZoomHeight: TToolButton;
tbZoom100: TToolButton; tbZoom100: TToolButton;
ToolButton1: TToolButton; tbPageMargins: TToolButton;
tbHeaderFooter: TToolButton; tbHeaderFooter: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
tbDivider5: TToolButton;
tbDivider4: TToolButton; tbDivider4: TToolButton;
tbPortraint: TToolButton; tbPortrait: TToolButton;
tbLandscape: TToolButton; tbLandscape: TToolButton;
tbDivider5: TToolButton;
tbPageSetup: TToolButton;
tbPrintColsFirst: TToolButton;
tbPrintRowsFirst: TToolButton;
tbCenterHor: TToolButton;
tbCenterVert: TToolButton;
tbDivider6: TToolButton;
tbDivider7: TToolButton;
procedure acCenterHorExecute(Sender: TObject);
procedure acCenterVertExecute(Sender: TObject);
procedure acCloseExecute(Sender: TObject); procedure acCloseExecute(Sender: TObject);
procedure acFirstPageExecute(Sender: TObject); procedure acFirstPageExecute(Sender: TObject);
procedure acHeaderFooterExecute(Sender: TObject); procedure acHeaderFooterExecute(Sender: TObject);
@ -115,6 +145,7 @@ type
FDraggedPos: Integer; FDraggedPos: Integer;
FGridPrinter: TGridPrinter; FGridPrinter: TGridPrinter;
FHintWindow: THintWindow; FHintWindow: THintWindow;
FInfoMask: String;
FPageCount: Integer; FPageCount: Integer;
FPageNumber: Integer; FPageNumber: Integer;
FOptions: TGridPrintPreviewOptions; FOptions: TGridPrintPreviewOptions;
@ -165,6 +196,8 @@ uses
const const
ZOOM_MULTIPLIER = 1.05; ZOOM_MULTIPLIER = 1.05;
CHECKMARK = #$E2#$9C#$93; // Checkmark characer in UTF-8
SPACE_CHECKMARK = ' ' + CHECKMARK;
{ Returns true when X1 is in range between X2-Delta and X2+Delta. } { Returns true when X1 is in range between X2-Delta and X2+Delta. }
function InRange(X1, X2, Delta: Integer): Boolean; inline; function InRange(X1, X2, Delta: Integer): Boolean; inline;
@ -185,6 +218,16 @@ begin
Result := X; Result := X;
end; end;
{ Appends a checkmark to the given caption string if AEnable is true.
Meant to better show the checked state of menu items having icons. }
function MarkAsChecked(ACaption: String; AEnable: Boolean): String;
begin
if AEnable then
Result := ACaption + SPACE_CHECKMARK
else
Result := ACaption;
end;
{ TGridPrintPreviewForm } { TGridPrintPreviewForm }
constructor TGridPrintPreviewForm.Create(AOwner: TComponent); constructor TGridPrintPreviewForm.Create(AOwner: TComponent);
@ -208,6 +251,32 @@ begin
ModalResult := mrCancel; ModalResult := mrCancel;
end; end;
procedure TGridPrintPreviewForm.acCenterHorExecute(Sender: TObject);
begin
if Assigned(FGridPrinter) then
begin
if acCenterHor.Checked then
FGridPrinter.Options := FGridPrinter.Options + [gpoCenterHor]
else
FGridPrinter.Options := FGridPrinter.Options - [gpoCenterHor];
acCenterHor.Caption := MarkAsChecked(RSCenterHor, acCenterHor.Checked);
ShowPage(FPageNumber);
end;
end;
procedure TGridPrintPreviewForm.acCenterVertExecute(Sender: TObject);
begin
if Assigned(FGridPrinter) then
begin
if acCenterVert.Checked then
FGridPrinter.Options := FGridPrinter.Options + [gpoCenterVert]
else
FGridPrinter.Options := FGridPrinter.Options - [gpoCenterVert];
acCenterVert.Caption := MarkAsChecked(RSCenterVert, acCenterVert.Checked);
ShowPage(FPageNumber);
end;
end;
procedure TGridPrintPreviewForm.acFirstPageExecute(Sender: TObject); procedure TGridPrintPreviewForm.acFirstPageExecute(Sender: TObject);
begin begin
ShowPage(1); ShowPage(1);
@ -232,6 +301,8 @@ begin
if Assigned(FGridPrinter) then if Assigned(FGridPrinter) then
begin begin
acLandscape.Checked := true; acLandscape.Checked := true;
acLandscape.Caption := MarkAsChecked(RSLandscape, true);
acPortrait.Caption := MarkAsChecked(RSPortrait, false);
FGridPrinter.Orientation := poLandscape; FGridPrinter.Orientation := poLandscape;
ShowPage(FPageNumber); ShowPage(FPageNumber);
end; end;
@ -259,6 +330,8 @@ begin
if Assigned(FGridPrinter) then if Assigned(FGridPrinter) then
begin begin
acPortrait.Checked := true; acPortrait.Checked := true;
acPortrait.Caption := MarkAsChecked(RSPortrait, true);
acLandscape.Caption := MarkAsChecked(RSLandscape, false);
FGridPrinter.Orientation := poPortrait; FGridPrinter.Orientation := poPortrait;
ShowPage(FPageNumber); ShowPage(FPageNumber);
end; end;
@ -275,6 +348,8 @@ begin
if Assigned(FGridPrinter) then if Assigned(FGridPrinter) then
begin begin
acPrintColsFirst.Checked := true; acPrintColsFirst.Checked := true;
acPrintColsFirst.Caption := MarkAsChecked(RSPrintColsFirst, true);
acPrintRowsFirst.Caption := RSPrintRowsFirst;
FGridPrinter.PrintOrder := poColsFirst; FGridPrinter.PrintOrder := poColsFirst;
ShowPage(FPageNumber); ShowPage(FPageNumber);
end; end;
@ -290,6 +365,8 @@ begin
if Assigned(FGridPrinter) then if Assigned(FGridPrinter) then
begin begin
acPrintRowsFirst.Checked := true; acPrintRowsFirst.Checked := true;
acPrintRowsFirst.Caption := MarkAsChecked(RSPrintRowsFirst, true);
acPrintColsFirst.Caption := RSPrintColsFirst;
FGridPrinter.PrintOrder := poRowsFirst; FGridPrinter.PrintOrder := poRowsFirst;
ShowPage(FPageNumber); ShowPage(FPageNumber);
end; end;
@ -324,8 +401,10 @@ begin
acLandscape.Enabled := (FGridPrinter <> nil); acLandscape.Enabled := (FGridPrinter <> nil);
acHeaderFooter.Enabled := acPrint.Enabled; acHeaderFooter.Enabled := acPrint.Enabled;
acPageMargins.Enabled := acPrint.Enabled; acPageMargins.Enabled := acPrint.Enabled;
acPrintColsFirst.Enabled := acPrint.Enabled;; acPrintColsFirst.Enabled := acPrint.Enabled;
acPrintRowsFirst.Enabled := acPrint.Enabled;; acPrintRowsFirst.Enabled := acPrint.Enabled;
acCenterHor.Enabled := acPrint.Enabled;
acCenterVert.Enabled := acPrint.Enabled;
end; end;
procedure TGridPrintPreviewForm.acZoomInZoomOutExecute(Sender: TObject); procedure TGridPrintPreviewForm.acZoomInZoomOutExecute(Sender: TObject);
@ -771,30 +850,45 @@ begin
begin begin
FGridPrinter := AValue; FGridPrinter := AValue;
case FGridPrinter.Orientation of case FGridPrinter.Orientation of
poPortrait: acPortrait.Checked := true; poPortrait:
poLandscape: acLandscape.Checked := true; acPortrait.Checked := true;
poLandscape:
acLandscape.Checked := true;
end; end;
case FGridPrinter.PrintOrder of case FGridPrinter.PrintOrder of
poRowsFirst: acPrintRowsFirst.Checked := true; poRowsFirst:
poColsFirst: acPrintColsFirst.Checked := true; acPrintRowsFirst.Checked := true;
poColsFirst:
acPrintColsFirst.Checked := true;
end; end;
acCenterHor.Checked := gpoCenterHor in FGridPrinter.Options;
acCenterVert.Checked := gpoCenterVert in FGridPrinter.Options;
acPortrait.Caption := MarkAsChecked(RSPortrait, acPortrait.Checked);
acLandscape.Caption := MarkAsChecked(RSLandscape, acLandscape.Checked);
acPrintRowsFirst.Caption := MarkAsChecked(RSPrintRowsFirst, acPrintRowsFirst.Checked);
acPrintColsFirst.Caption := MarkAsChecked(RSPrintColsFirst, acPrintColsFirst.Checked);
acCenterHor.Caption := MarkAsChecked(RSCenterHor, acCenterHor.Checked);
acCenterVert.Caption := MarkAsChecked(RSCenterVert, acCenterVert.Checked);
end; end;
SetOptions(FOptions);
end; end;
procedure TGridPrintPreviewForm.SetOptions(AValue: TGridPrintPreviewOptions); procedure TGridPrintPreviewForm.SetOptions(AValue: TGridPrintPreviewOptions);
begin begin
if FOptions <> AValue then //if FOptions <> AValue then
begin begin
FOptions := AValue; FOptions := AValue;
// Page navigation
acFirstPage.Visible := ppoNavigationBtns in FOptions; acFirstPage.Visible := ppoNavigationBtns in FOptions;
acPrevpage.Visible := acFirstpage.Visible; acPrevpage.Visible := acFirstpage.Visible;
acNextPage.Visible := acFirstPage.Visible; acNextPage.Visible := acFirstPage.Visible;
acLastPage.Visible := acFirstPage.Visible; acLastPage.Visible := acFirstPage.Visible;
edPageNumber.Visible := ppoNavigationEdit in FOptions; PageNoEditPanel.Visible := ppoNavigationEdit in FOptions;
tbDivider1.Visible := acFirstPage.Visible or edPageNumber.Visible; tbDivider1.Visible := acFirstPage.Visible or PageNoEditPanel.Visible;
// Zooming
acZoomIn.Visible := ppoZoomBtns in FOptions; acZoomIn.Visible := ppoZoomBtns in FOptions;
acZoomOut.Visible := acZoomIn.Visible; acZoomOut.Visible := acZoomIn.Visible;
acZoom100.Visible := acZoomIn.Visible; acZoom100.Visible := acZoomIn.Visible;
@ -802,15 +896,78 @@ begin
acZoomtoFitHeight.Visible := acZoomIn.Visible; acZoomtoFitHeight.Visible := acZoomIn.Visible;
tbDivider2.Visible := acZoomIn.Visible; tbDivider2.Visible := acZoomIn.Visible;
acPortrait.Visible := ppoPageOrientationBtns in FOptions; // Page orientation, header/footer and page margins
acLandscape.Visible := acPortrait.Visible; if ppoPageOrientationBtns in FOptions then
acHeaderFooter.Visible := ppoHeaderFooterBtn in FOptions; begin
acPageMargins.Visible := ppoMarginsBtn in FOptions; tbPortrait.Action := acPortrait;
tbDivider3.Visible := acPortrait.Visible or acHeaderFooter.Visible or acPageMargins.Visible; tbLandscape.Action := acLandscape;
end else
begin
tbPortrait.Action := nil;
tbLandscape.Action := nil;
end;
tbPortrait.Visible := tbPortrait.Action <> nil;
tbLandscape.Visible := tbLandscape.Action <> nil;
acPrintColsFirst.Visible := ppoPrintOrderBtns in FOptions; if ppoHeaderFooterBtn in FOptions then
acPrintRowsFirst.Visible := acPrintColsFirst.Visible; tbHeaderFooter.Action := acHeaderFooter
tbDivider4.Visible := acPrintColsFirst.Visible; else
tbHeaderFooter.Action := nil;
tbHeaderFooter.Visible := tbHeaderFooter.Action <> nil;
if ppoMarginsBtn in FOptions then
tbPageMargins.Action := acPageMargins
else
tbPageMargins.Action := nil;
tbPageMargins.Visible := tbPageMargins.Action <> nil;
tbDivider3.Visible :=
(FOptions * [ppoPageOrientationBtns, ppoHeaderFooterBtn, ppoMarginsBtn] <> []);
// Print order
if ppoPrintOrderBtns in FOptions then
begin
tbPrintColsFirst.Action := acPrintColsFirst;
tbPrintRowsFirst.Action := acPrintRowsFirst;
end else
begin
tbPrintColsFirst.Action := nil;
tbPrintRowsFirst.Action := nil;
end;
tbPrintColsFirst.Visible := tbPrintColsFirst.Action <> nil;
tbPrintRowsFirst.Visible := tbPrintRowsFirst.Action <> nil;
tbDivider4.Visible := tbPrintColsFirst.Visible;
// Page centering
if ppoCenterBtns in FOptions then
begin
tbCenterHor.Action := acCenterHor;
tbCenterVert.Action := acCenterVert;
end else
begin
tbCenterHor.Action := nil;
tbCenterVert.Action := nil;
end;
tbCenterHor.Visible := tbCenterHor.Action <> nil;
tbCenterVert.Visible := tbCenterVert.Action <> nil;
tbDivider5.Visible := tbCenterHor.Action <> nil;
// Page setup dropdown button
tbPageSetup.Visible := ppoPageSetupBtn in FOptions;
tbDivider6.Visible := tbPageSetup.Visible;
// Page number info
if FOptions * [ppoPageNumberInfo, ppoZoomLevelInfo] = [ppoPageNumberInfo, ppoZoomLevelInfo] then
FInfoMask := RSPageAndZoomInfo
else
if (ppoPageNumberInfo in FOptions) then
FInfoMask := RSPageInfo
else
if (ppoZoomLevelInfo in FOptions) then
FInfoMask := RSZoomInfo
else
FInfoMask := '';
InfoPanel.Visible := FInfoMask <> '';
end; end;
end; end;
@ -877,9 +1034,14 @@ end;
procedure TGridPrintPreviewForm.UpdateInfoPanel; procedure TGridPrintPreviewForm.UpdateInfoPanel;
begin begin
InfoPanel.Caption := Format(RSPageAndZoomInfo, [FPageNumber, FPageCount, FZoom]); if FOptions * [ppoPageNumberInfo, ppoZoomLevelInfo] <> [] then
begin
InfoPanel.Caption := Format(FInfoMask, [FPageNumber, FPageCount, FZoom]);
InfoPanel.Width := InfoPanel.Canvas.TextWidth(InfoPanel.Caption); InfoPanel.Width := InfoPanel.Canvas.TextWidth(InfoPanel.Caption);
InfoPanel.Left := Toolbar.ClientWidth - InfoPanel.Width - 8; InfoPanel.Left := Toolbar.ClientWidth - InfoPanel.Width - 8;
InfoPanel.Show;
end else
InfoPanel.Hide;
edPageNumber.Text := IntToStr(FPageNumber); edPageNumber.Text := IntToStr(FPageNumber);
end; end;
@ -890,6 +1052,14 @@ begin
// Toolbar captions // Toolbar captions
acPrint.Caption := RSPrint; acPrint.Caption := RSPrint;
acClose.Caption := RSClose; acClose.Caption := RSClose;
acPortrait.Caption := RSPortrait;
acLandscape.Caption := RSLandscape;
acHeaderFooter.Caption := RSHeaderFooter;
acPageMargins.Caption := RSPageMargins;
acPrintColsFirst.Caption := RSPrintColsFirst;
acPrintRowsFirst.Caption := RSPrintRowsFirst;
acCenterHor.Caption := RSCenterHor;
acCenterVert.Caption := RSCenterVert;
// Toolbar hints // Toolbar hints
acPrint.Hint := RSPrint; acPrint.Hint := RSPrint;
@ -904,11 +1074,15 @@ begin
acZoomToFitHeight.Hint := RSZoomToFitPageHeight; acZoomToFitHeight.Hint := RSZoomToFitPageHeight;
acZoom100.Hint := RSOriginalSize; acZoom100.Hint := RSOriginalSize;
acPageMargins.Hint := RSPageMarginsConfig; acPageMargins.Hint := RSPageMarginsConfig;
acHeaderFooter.Hint := RSHeaderFooterConfig; acPortrait.Hint := RSPortraitHint;
acPortrait.Hint := RSPortraitPageOrientation; acLandscape.Hint := RSLandscapeHint;
acLandscape.Hint := RSLandscapePageOrientation; acHeaderFooter.Hint := RSHeaderFooterHint;
acPrintColsFirst.Hint := RSPrintColsFirst; acPageMargins.Hint := RSPageMarginsHint;
acPrintRowsFirst.Hint := RSPrintRowsFirst; acPrintColsFirst.Hint := RSPrintColsFirstHint;
acPrintRowsFirst.Hint := RSPrintRowsFirstHint;
acCenterHor.Hint := RSCenterHorHint;
acCenterVert.Hint := RSCenterVertHint;
tbPageSetup.Hint := RSPageSetupHint;
end; end;

View File

@ -23,13 +23,27 @@ resourcestring
RSZoomToFitPageHeight = 'Zoom to fit page height'; RSZoomToFitPageHeight = 'Zoom to fit page height';
RSOriginalSize = 'Original size (100%)'; RSOriginalSize = 'Original size (100%)';
RSPageMarginsConfig = 'Page margins configuration'; RSPageMarginsConfig = 'Page margins configuration';
RSHeaderFooterConfig = 'Header/footer configuration'; RSPortrait = 'Portrait';
RSPortraitPageOrientation = 'Portrait page orientation'; RSPortraitHint = 'Portrait page orientation';
RSLandscapePageOrientation = 'Landscape page orientation'; RSLandscape = 'Landscape';
RSPrintColsFirst = 'First print columns from top to bottom,' + LineEnding + RSLandscapeHint = 'Landscape page orientation';
RSHeaderFooter = 'Header/footer...';
RSHeaderFooterHint = 'Header/footer configuration';
RSPageMargins = 'Margins';
RSPageMarginsHint = 'Page margins';
RSPrintColsFirst = 'Columns first';
RSPrintColsFirstHint = 'First print columns from top to bottom,' + LineEnding +
'then print from left to right'; 'then print from left to right';
RSPrintRowsFirst = 'First print rows from left to right,' + LineEnding + RSPrintRowsFirst = 'Rows first';
RSPrintRowsFirstHint = 'First print rows from left to right,' + LineEnding +
'then print from top to bottom'; 'then print from top to bottom';
RSCenterHor = 'Center horizontally';
RSCenterHorHint = 'Center grid in page horizontally';
RSCenterVert = 'Center vertically';
RSCenterVertHint = 'Center grid in page vertically';
RSPageSetupHint = 'Page setup options';
RSPageInfoPanel = 'Page numbers';
RSZoomInfoPanel = 'Zoom level';
RSLeftMargin = 'Left margin'; RSLeftMargin = 'Left margin';
RSTopMargin = 'Top margin'; RSTopMargin = 'Top margin';
@ -38,7 +52,9 @@ resourcestring
RSHeaderMargin = 'Header margin'; RSHeaderMargin = 'Header margin';
RSFooterMargin = 'Footer margin'; RSFooterMargin = 'Footer margin';
RSPageAndZoomInfo = 'Page %d of %d, Zoom %d %%'; RSPageInfo = 'Page %0:d of %1:d';
RSZoomInfo = 'Zoom %2:d %%';
RSPageAndZoomInfo = 'Page %0:d of %1:d, Zoom %2:d %%';
// Header / footer // Header / footer
RSHeader = 'Header'; RSHeader = 'Header';