mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 04:20:29 +01:00
added to dialogs TCustomPrintDialog
git-svn-id: trunk@7731 -
This commit is contained in:
parent
02ef7c9c49
commit
adf316e7c4
@ -44,12 +44,10 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Buttons, ExtCtrls, Spin, MaskEdit, ComCtrls,LCLType,
|
||||
Printers,osPrinters,
|
||||
Printers, osPrinters,
|
||||
CUPSDyn,libc;
|
||||
|
||||
type
|
||||
TPrintRange = (prAllPages, prCurrentPage, prSelection, prPageNums);
|
||||
|
||||
TdlgSelectPrinter = class(TForm)
|
||||
Bevel1: TBEVEL;
|
||||
btnProp: TBUTTON;
|
||||
|
||||
@ -24,46 +24,31 @@ unit PrintersDlgs;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,dialogs,Printers,osPrinters,LResources;
|
||||
Classes, SysUtils, Dialogs, Printers, osPrinters, LResources;
|
||||
|
||||
type
|
||||
{Type for compatibility with delphi}
|
||||
TPrintRange = (prAllPages,prSelection,prPageNums);
|
||||
TPrintDialogOption= (poPrintToFile,poPageNums,poSelection,
|
||||
poWarning,poHelp,poDisablePrintToFile);
|
||||
TPrintDialogOptions = set of TPrintDialogOption;
|
||||
|
||||
TPrinterSetupDialog = class(TCommonDialog)
|
||||
{ Type for compatibility with delphi }
|
||||
|
||||
TPrinterSetupDialog = class(TCustomPrinterSetupDialog)
|
||||
public
|
||||
function Execute: Boolean; override;
|
||||
end;
|
||||
|
||||
{ TPrintDialog }
|
||||
|
||||
TPrintDialog = class(TCommonDialog)
|
||||
private
|
||||
fFromPage : Integer;
|
||||
fToPage : Integer;
|
||||
fCollate : Boolean;
|
||||
fOptions : TPrintDialogOptions;
|
||||
fPrintToFile : Boolean;
|
||||
fPrintRange : TPrintRange;
|
||||
fMinPage : Integer;
|
||||
fMaxPage : Integer;
|
||||
fCopies : Integer;
|
||||
TPrintDialog = class(TCustomPrintDialog)
|
||||
public
|
||||
function Execute: Boolean; override;
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
published
|
||||
property Collate: Boolean read fCollate write fCollate default False;
|
||||
property Copies: Integer read fCopies write fCopies default 0;
|
||||
property FromPage: Integer read fFromPage write fFromPage default 0;
|
||||
property MinPage: Integer read fMinPage write fMinPage default 0;
|
||||
property MaxPage: Integer read fMaxPage write fMaxPage default 0;
|
||||
property Options: TPrintDialogOptions read fOptions write fOptions default [];
|
||||
property PrintToFile: Boolean read fPrintToFile write fPrintToFile default False;
|
||||
property PrintRange: TPrintRange read fPrintRange write fPrintRange default prAllPages;
|
||||
property ToPage: Integer read fToPage write fToPage default 0;
|
||||
property Collate;
|
||||
property Copies;
|
||||
property FromPage;
|
||||
property MinPage;
|
||||
property MaxPage;
|
||||
property Options;
|
||||
property PrintToFile;
|
||||
property PrintRange;
|
||||
property ToPage;
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
@ -91,21 +76,8 @@ begin
|
||||
Result:=Printer.PrintDialog;
|
||||
end;
|
||||
|
||||
constructor TPrintDialog.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
fCollate:=False;
|
||||
fCopies :=1;
|
||||
fFromPage:=0;
|
||||
fToPage:=0;
|
||||
fMinPage:=0;
|
||||
fMaxPage:=0;
|
||||
fOptions:=[];
|
||||
fPrintToFile:=False;
|
||||
fPrintRange:=prAllPages;
|
||||
end;
|
||||
|
||||
INITIALIZATION
|
||||
{$I printersdlgs.lrs}
|
||||
initialization
|
||||
{$I printersdlgs.lrs}
|
||||
|
||||
end.
|
||||
|
||||
|
||||
@ -5790,7 +5790,7 @@ var ActiveSrcEdit: TSourceEditor;
|
||||
// If FName is not found, we'll check extensions pp and pas too
|
||||
// Returns true if found. FName contains the full file+path in that case
|
||||
var TempFile,TempPath,CurPath,FinalFile, Ext: String;
|
||||
i,p,c: Integer;
|
||||
p,c: Integer;
|
||||
PasExt: TPascalExtType;
|
||||
begin
|
||||
if SPath='' then SPath:='.';
|
||||
|
||||
@ -20,16 +20,6 @@
|
||||
* *
|
||||
*****************************************************************************
|
||||
}
|
||||
|
||||
{
|
||||
@author(TMyClass - Michael A. Hess <author@emailaddress.com>)
|
||||
@author(TMyOtherClass - Other Author Name <otherauthor@emailaddress.com>)
|
||||
@created()
|
||||
@lastmod()
|
||||
|
||||
Detailed description of the Unit.
|
||||
}
|
||||
|
||||
unit Dialogs;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
@ -311,6 +301,47 @@ type
|
||||
frHideUpDown, frMatchCase, frDisableMatchCase, frDisableUpDown,
|
||||
frDisableWholeWord, frReplace, frReplaceAll, frWholeWord, frShowHelp);
|
||||
TFindOptions = set of TFindOption;
|
||||
|
||||
|
||||
{ TPrinterSetupDialog }
|
||||
|
||||
TCustomPrinterSetupDialog = class(TCommonDialog)
|
||||
end;
|
||||
|
||||
|
||||
{ TPrintDialog }
|
||||
|
||||
TPrintRange = (prAllPages, prSelection, prPageNums, prCurrentPage);
|
||||
TPrintDialogOption = (poPrintToFile, poPageNums, poSelection, poWarning,
|
||||
poHelp, poDisablePrintToFile);
|
||||
TPrintDialogOptions = set of TPrintDialogOption;
|
||||
|
||||
TCustomPrintDialog = class(TCommonDialog)
|
||||
private
|
||||
FFromPage: Integer;
|
||||
FNumCopies: Integer;
|
||||
FToPage: Integer;
|
||||
FCollate: Boolean;
|
||||
FOptions: TPrintDialogOptions;
|
||||
FPrintToFile: Boolean;
|
||||
FPrintRange: TPrintRange;
|
||||
FMinPage: Integer;
|
||||
FMaxPage: Integer;
|
||||
FCopies: Integer;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
public
|
||||
property Collate: Boolean read FCollate write FCollate default False;
|
||||
property Copies: Integer read FCopies write FNumCopies default 0;
|
||||
property FromPage: Integer read FFromPage write FFromPage default 0;
|
||||
property MinPage: Integer read FMinPage write FMinPage default 0;
|
||||
property MaxPage: Integer read FMaxPage write FMaxPage default 0;
|
||||
property Options: TPrintDialogOptions read FOptions write FOptions default [];
|
||||
property PrintToFile: Boolean read FPrintToFile write FPrintToFile default False;
|
||||
property PrintRange: TPrintRange read FPrintRange write FPrintRange default prAllPages;
|
||||
property ToPage: Integer read FToPage write FToPage default 0;
|
||||
end;
|
||||
|
||||
|
||||
{ MessageDlg }
|
||||
|
||||
@ -425,6 +456,14 @@ end;
|
||||
{$I promptdialog.inc}
|
||||
{$I colorbutton.inc}
|
||||
|
||||
{ TCustomPrintDialog }
|
||||
|
||||
constructor TCustomPrintDialog.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
FPrintRange:=prAllPages;
|
||||
end;
|
||||
|
||||
initialization
|
||||
Forms.MessageBoxFunction:=@ShowMessageBox;
|
||||
InterfaceBase.InputDialogFunction:=@ShowInputDialog;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user