diff --git a/components/printers/printersdlgs.pp b/components/printers/printersdlgs.pp index 62cdc87a33..07f0cf77d6 100644 --- a/components/printers/printersdlgs.pp +++ b/components/printers/printersdlgs.pp @@ -54,7 +54,7 @@ type TPageSetupDialogOptions = set of TPageSetupDialogOption; const - cDefaultPageSetupDialogOptions = [psoMargins]; + cDefaultPageSetupDialogOptions = [psoMargins, psoMinMargins]; cDefaultPageSetupMargin = 0; cDefaultPageSetupMinMargin = 400; //400: in mm it's 4mm, in inches it's ~10mm diff --git a/components/printers/unix/cupsprndialogs.inc b/components/printers/unix/cupsprndialogs.inc index 065e1de366..e0a2bfbe6b 100644 --- a/components/printers/unix/cupsprndialogs.inc +++ b/components/printers/unix/cupsprndialogs.inc @@ -130,16 +130,29 @@ begin Dlg.frmPageSetup.txtRight.DecimalPlaces:= NDigits; Dlg.frmPageSetup.txtBottom.DecimalPlaces:= NDigits; - // Delphi wiki: MarginNNN holds value in 1/1000 parts of current Unit - Dlg.frmPageSetup.txtLeft.Value:= FMarginLeft/NScale; - Dlg.frmPageSetup.txtTop.Value:= FMarginTop/NScale; - Dlg.frmPageSetup.txtRight.Value:= FMarginRight/NScale; - Dlg.frmPageSetup.txtBottom.Value:= FMarginBottom/NScale; + if psoMargins in Options then + begin + Dlg.frmPageSetup.txtLeft.Value:= FMarginLeft/NScale; + Dlg.frmPageSetup.txtTop.Value:= FMarginTop/NScale; + Dlg.frmPageSetup.txtRight.Value:= FMarginRight/NScale; + Dlg.frmPageSetup.txtBottom.Value:= FMarginBottom/NScale; + end + else + begin + //if no psoMargins, set margins 1 inch or 10 mm + Dlg.frmPageSetup.txtLeft.Value:= 1000/NScale; + Dlg.frmPageSetup.txtTop.Value:= 1000/NScale; + Dlg.frmPageSetup.txtRight.Value:= 1000/NScale; + Dlg.frmPageSetup.txtBottom.Value:= 1000/NScale; + end; - Dlg.frmPageSetup.txtLeft.MinValue:= FMinMarginLeft/NScale; - Dlg.frmPageSetup.txtTop.MinValue:= FMinMarginTop/NScale; - Dlg.frmPageSetup.txtRight.MinValue:= FMinMarginRight/NScale; - Dlg.frmPageSetup.txtBottom.MinValue:= FMinMarginBottom/NScale; + if psoMinMargins in Options then + begin + Dlg.frmPageSetup.txtLeft.MinValue:= FMinMarginLeft/NScale; + Dlg.frmPageSetup.txtTop.MinValue:= FMinMarginTop/NScale; + Dlg.frmPageSetup.txtRight.MinValue:= FMinMarginRight/NScale; + Dlg.frmPageSetup.txtBottom.MinValue:= FMinMarginBottom/NScale; + end; Dlg.frmPageSetup.txtLeft.Increment:= NInc; Dlg.frmPageSetup.txtTop.Increment:= NInc; diff --git a/components/printers/unix/framepagesetup.lfm b/components/printers/unix/framepagesetup.lfm index ca4616b074..bb9014320e 100644 --- a/components/printers/unix/framepagesetup.lfm +++ b/components/printers/unix/framepagesetup.lfm @@ -5,7 +5,6 @@ object framePageSetup: TframePageSetup Width = 448 ClientHeight = 435 ClientWidth = 448 - LCLVersion = '1.9.0.0' TabOrder = 0 DesignLeft = 350 DesignTop = 92 @@ -252,6 +251,19 @@ object framePageSetup: TframePageSetup TabOrder = 1 OnMouseDown = pbPreviewMouseDown OnResize = panPreviewResize + object boxShadow: TShape + AnchorSideLeft.Control = pbPreview + AnchorSideTop.Control = pbPreview + AnchorSideRight.Side = asrCenter + Left = 180 + Height = 65 + Top = 53 + Width = 124 + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + Brush.Color = clGrayText + Pen.Color = clGrayText + end object pbPreview: TPaintBox AnchorSideLeft.Control = panPreview AnchorSideLeft.Side = asrCenter diff --git a/components/printers/unix/framepagesetup.pas b/components/printers/unix/framepagesetup.pas index a3be0b2386..570e0d7f03 100644 --- a/components/printers/unix/framepagesetup.pas +++ b/components/printers/unix/framepagesetup.pas @@ -27,6 +27,7 @@ type cbPaper: TComboBox; cbSource: TComboBox; panMargins: TPanel; + boxShadow: TShape; txtLeft: TFloatSpinEdit; txtTop: TFloatSpinEdit; txtRight: TFloatSpinEdit; @@ -242,6 +243,9 @@ begin begin PbPreview.Width := Round(FFactorX * (Right - Left) * FZoom) + 2; PbPreview.Height := Round(FFactorY * (Bottom - Top) * FZoom) + 2; + + boxShadow.Width := pbPreview.Width; + boxShadow.Height := pbPreview.Height; end; with Printer.PaperSize.PaperRect do