-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathPrintStatusUnit.pas
57 lines (44 loc) · 1.04 KB
/
PrintStatusUnit.pas
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
unit PrintStatusUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls;
type
TPrintStatusForm = class(TForm)
PrintingLabel: TLabel;
PagesLabel: TLabel;
CancelButton: TButton;
procedure FormShow(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure CancelButtonClick(Sender: TObject);
procedure NextPage;
private
Page: integer;
public
Cancelled: boolean;
end;
var
PrintStatusForm: TPrintStatusForm;
implementation
uses PrintUnit;
{$R *.DFM}
procedure TPrintStatusForm.FormShow(Sender: TObject);
begin
Cancelled := False;
Page := 0;
NextPage;
end;
procedure TPrintStatusForm.FormActivate(Sender: TObject);
begin
Refresh;
end;
procedure TPrintStatusForm.CancelButtonClick(Sender: TObject);
begin
Cancelled := True;
end;
procedure TPrintStatusForm.NextPage;
begin
PagesLabel.Caption := IntToStr(Page) + ' of ' + IntToStr(PrintForm.Pages);
PagesLabel.Refresh;
Inc(Page);
end;
end.