mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 00:40:18 +02:00
Printers4Lazarus: fixed PrintDialog, especially save to PDF
git-svn-id: trunk@13262 -
This commit is contained in:
parent
e25982fd40
commit
b1ec8a62c7
@ -292,22 +292,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCarbonPrinter.UpdatePrinter;
|
||||
var
|
||||
S: TStringList;
|
||||
P: String;
|
||||
begin
|
||||
ValidatePrintSettings;
|
||||
|
||||
P := GetCurrentPrinterName;
|
||||
|
||||
S := TStringList.Create;
|
||||
try
|
||||
DoEnumPrinters(S);
|
||||
//DebugLn('UpdatePrinter ' + P + ' ' + DbgS(S.IndexOf(P)));
|
||||
PrinterIndex := S.IndexOf(P);
|
||||
finally
|
||||
S.Free;
|
||||
end;
|
||||
SetPrinter(GetCurrentPrinterName);
|
||||
Validate;
|
||||
end;
|
||||
|
||||
|
@ -45,6 +45,7 @@ var
|
||||
CarbonPrinter: TCarbonPrinter;
|
||||
DialogSettings: PMPrintSettings;
|
||||
V: UInt32;
|
||||
PFrom, PTo: Integer;
|
||||
begin
|
||||
Result := False;
|
||||
// TODO: Options, Title
|
||||
@ -65,10 +66,12 @@ begin
|
||||
OSError(PMSetCopies(DialogSettings, Copies, False), Self, SExecute, 'PMSetCopies');
|
||||
OSError(PMSetPageRange(DialogSettings, MinPage, MaxPage),
|
||||
Self, SExecute, 'PMSetPageRange');
|
||||
OSError(PMSetFirstPage(DialogSettings, FromPage, False), Self, SExecute, 'PMSetFirstPage');
|
||||
OSError(PMSetLastPage(DialogSettings, ToPage, False), Self, SExecute, 'PMSetLastPage');
|
||||
PFrom := Max(FromPage, MinPage);
|
||||
OSError(PMSetFirstPage(DialogSettings, PFrom, False), Self, SExecute, 'PMSetFirstPage');
|
||||
PTo := Max(PFrom, Min(ToPage, MaxPage));
|
||||
OSError(PMSetLastPage(DialogSettings, PTo, False), Self, SExecute, 'PMSetLastPage');
|
||||
|
||||
if OSError(PMSessionPrintDialog(CarbonPrinter.PrintSession, CarbonPrinter.PrintSettings, CarbonPrinter.PageFormat, Result),
|
||||
if OSError(PMSessionPrintDialog(CarbonPrinter.PrintSession, DialogSettings, CarbonPrinter.PageFormat, Result),
|
||||
Self, SExecute, 'PMSessionPrintDialog') then Exit;
|
||||
|
||||
if Result then
|
||||
|
@ -83,7 +83,7 @@ uses Controls, udlgSelectPrinter, udlgPropertiesPrinter, FileUtil;
|
||||
|
||||
{$ELSE}
|
||||
|
||||
uses Controls, CarbonProc, FPCMacOSAll, LCLProc;
|
||||
uses Controls, Math, CarbonProc, FPCMacOSAll, LCLProc;
|
||||
{$I carbonprndialogs.inc}
|
||||
|
||||
{$ENDIF}
|
||||
|
Loading…
Reference in New Issue
Block a user