-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogress_bar_unit.pas
65 lines (51 loc) · 1.26 KB
/
progress_bar_unit.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
58
59
60
61
62
63
64
65
unit progress_bar_unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, acProgressBar, sLabel;
type
Tprogress_bar_form = class(TForm)
progress: TsProgressBar;
title: TsLabel;
detail_text: TsLabel;
ammount_done: TsLabel;
private
{ Private declarations }
public
{ Public declarations }
text : string;
ammount : Integer;
procedure SetAmmount( number:integer );
procedure SetTitle( title_text:string );
procedure Next();
procedure Show();
procedure Hide();
end;
var
progress_bar_form: Tprogress_bar_form;
implementation
{$R *.dfm}
procedure Tprogress_bar_form.SetAmmount( number:integer );
begin
progress.position := 0;
progress.Max := number;
end;
procedure Tprogress_bar_form.Next();
begin
progress.position := progress.position + 1;
ammount_done.Caption := Format('%s èç %s', [ IntToStr(progress.Position), IntToStr( progress.Max) ] );
Application.ProcessMessages;
end;
procedure Tprogress_bar_form.Show();
begin
Self.Visible := true;
end;
procedure Tprogress_bar_form.Hide();
begin
Self.Visible := false;
end;
procedure Tprogress_bar_form.SetTitle( title_text:string );
begin
title.Caption := title_text;
end;
end.