mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 13:39:11 +02:00
added abstractg TPrinter exception
git-svn-id: trunk@7596 -
This commit is contained in:
parent
700fb8a658
commit
f9c8897739
@ -220,6 +220,9 @@ implementation
|
|||||||
|
|
||||||
constructor TPrinter.Create;
|
constructor TPrinter.Create;
|
||||||
begin
|
begin
|
||||||
|
if ClassType=TPrinter then
|
||||||
|
raise Exception.Create('TPrinter is an abstract base class.'
|
||||||
|
+' Please use a printer implementation like the package printers4lazarus.');
|
||||||
Inherited Create;
|
Inherited Create;
|
||||||
fPrinterIndex:=-1; //By default, use the default printer
|
fPrinterIndex:=-1; //By default, use the default printer
|
||||||
fCanvas:=nil;
|
fCanvas:=nil;
|
||||||
@ -457,7 +460,8 @@ begin
|
|||||||
if aValue<1 then aValue:=1;
|
if aValue<1 then aValue:=1;
|
||||||
if Printers.Count>0 then
|
if Printers.Count>0 then
|
||||||
DoSetCopies(aValue)
|
DoSetCopies(aValue)
|
||||||
else raise EPrinter.Create('zero printer definied !');
|
else
|
||||||
|
raise EPrinter.Create('No printer found.');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPrinter.SetOrientation(const AValue: TPrinterOrientation);
|
procedure TPrinter.SetOrientation(const AValue: TPrinterOrientation);
|
||||||
@ -484,7 +488,7 @@ begin
|
|||||||
|
|
||||||
SetPrinter(aName);
|
SetPrinter(aName);
|
||||||
end
|
end
|
||||||
else raise EPrinter.Create('zero printer definied !');
|
else raise EPrinter.Create('No printers defined !');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//If not Printer selected, Select the default printer
|
//If not Printer selected, Select the default printer
|
||||||
|
Loading…
Reference in New Issue
Block a user