forked from OneChen/ProgressCircle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.pas
56 lines (46 loc) · 1.2 KB
/
Main.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
unit Main;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Objects, FMX.StdCtrls,
FMX.Ani;
type
TForm1 = class(TForm)
Arc1: TArc;
TrackBar1: TTrackBar;
Circle1: TCircle;
Circle2: TCircle;
Text1: TText;
Button1: TButton;
FloatAnimation1: TFloatAnimation;
procedure TrackBar1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.Button1Click(Sender: TObject);
begin
if FloatAnimation1.Enabled then
Button1.Text := 'Start'
else Button1.Text := 'Stop';
FloatAnimation1.Enabled := not FloatAnimation1.Enabled;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
TrackBar1Change(Sender);
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
if TrackBar1.Value <> 0 then
Arc1.EndAngle := 360 / (100 / TrackBar1.Value)
else Arc1.EndAngle := 0;
Text1.Text := Trunc(TrackBar1.Value).ToString + '%';
end;
end.