Printers: Implement psoWarning in PageSetupDialog. Issue #33531, patch from AlexeyT.

git-svn-id: trunk@57613 -
This commit is contained in:
juha 2018-04-06 21:04:53 +00:00
parent c131224bf7
commit 96169209a1
3 changed files with 12 additions and 1 deletions

View File

@ -34,6 +34,7 @@ resourcestring
p4lrsPagesPerSheet = 'Pages per sheet';
p4lrsMargins = 'Margins';
p4lrsAdvanced = 'Advanced';
p4lrsNoDefaultPrinter = 'No default printer found';
implementation

View File

@ -27,7 +27,10 @@ interface
{$ENDIF}
uses
Classes, SysUtils, Forms, Controls, Dialogs, LResources, Printers, OsPrinters;
Classes, SysUtils, Forms, Controls, Dialogs,
LResources,
Printer4LazStrConst,
Printers, OsPrinters;
type
TPageMeasureUnits = (

View File

@ -88,6 +88,13 @@ var
NDigits, NScale: integer;
NInc: double;
begin
if Printer.PrinterIndex<0 then
begin
if psoWarning in Options then
MessageDlg(Title, p4lrsNoDefaultPrinter, mtWarning, [mbOk], 0);
exit(false);
end;
// w/o SetPrinter, list of paper names is different
// (Letter / US Letter, EnvMonarch / Envelope Monarch),
// and list of sources is empty