forked from lmbelo/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqrPrintText.pas
More file actions
96 lines (82 loc) · 3.36 KB
/
qrPrintText.pas
File metadata and controls
96 lines (82 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(**************************************************************************)
(* *)
(* PyDelphi Copyright (c) 1997 *)
(* *)
(* Morgan Martinet *)
(* 23 rue du 14 juillet *)
(* 94270 le Kremlin-Bicetre *)
(* Phone (Work): 01 47 25 70 77 *)
(* e-mail: [email protected] *)
(* *)
(**************************************************************************)
(* This source code is distributed with no WARRANTY, for no reason or use.*)
(* Everyone is allowed to use and change this code free for his own tasks *)
(* and projects, as long as this header and its copyright text is intact. *)
(* For changed versions of this code, which are public distributed the *)
(* following additional conditions have to be fullfilled: *)
(* 1) The header has to contain a comment on the change and the author of *)
(* it. *)
(* 2) A copy of the changed source has to be sent to the above E-Mail *)
(* address or my then valid address, if this is possible to the *)
(* author. *)
(* The second condition has the target to maintain an up to date central *)
(* version of the component. If this condition is not acceptable for *)
(* confidential or legal reasons, everyone is free to derive a component *)
(* or to generate a diff file to my or other original sources. *)
(**************************************************************************)
unit qrPrintText;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, quickrpt, Qrctrls;
type
TPrintText = class(TForm)
QRBand1: TQRBand;
Rep: TQuickRep;
QRLabel1: TQRLabel;
QRBand2: TQRBand;
QRSysData3: TQRSysData;
QRSysData1: TQRSysData;
QRSysData2: TQRSysData;
QRShape1: TQRShape;
procedure RepNeedData(Sender: TObject; var MoreData: Boolean);
procedure RepBeforePrint(Sender: TQuickRep; var PrintReport: Boolean);
private
{ Private declarations }
line : Integer;
public
{ Public declarations }
RichEdit : TRichEdit;
end;
var
PrintText: TPrintText;
implementation
{$R *.DFM}
procedure TPrintText.RepNeedData(Sender: TObject; var MoreData: Boolean);
var
tabs, i : Integer;
s : String;
begin
MoreData := line < RichEdit.Lines.Count;
if MoreData then
begin
tabs := 0;
s := RichEdit.lines.Strings[line];
for i := 1 to Length(s) do
if s[i] <> #9 then
Break
else
Inc(tabs);
s := Trim(s);
for i := 0 to tabs - 1 do
Insert( ' ', s, 1 );
QRLabel1.Caption := s;
Inc(line);
end;
end;
procedure TPrintText.RepBeforePrint(Sender: TQuickRep;
var PrintReport: Boolean);
begin
line := 0;
end;
end.