-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunit4.pas
109 lines (92 loc) · 3.42 KB
/
unit4.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
(******************************************************************************)
(* *)
(* Author : Uwe Schächterle (Corpsman) *)
(* *)
(* This file is part of CCM *)
(* *)
(* See the file license.md, located under: *)
(* https://github.com/PascalCorpsman/Software_Licenses/blob/main/license.md *)
(* for details about the license. *)
(* *)
(* It is not allowed to change or remove this text from any *)
(* source file of the project. *)
(* *)
(******************************************************************************)
Unit Unit4;
{$MODE objfpc}{$H+}
Interface
Uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
uccm;
Type
{ TForm4 }
TForm4 = Class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Procedure Button1Click(Sender: TObject);
Procedure FormCreate(Sender: TObject);
private
{ private declarations }
FAbbrechen: Boolean;
public
{ public declarations }
(*
* Restart = True => Abbrechen wird zu false
* Result = True => Benutzer hat Abbrechen gedrückt
*)
Property Abbrechen: Boolean read FAbbrechen;
(*
* Wenn Result = true => User hat abbrechen gedrückt
* = false => ganz normal weiter
*)
Function RefresStatsMethod(Filename: String; Count, Waypoints: integer; Restart: Boolean): Boolean;
End;
Var
Form4: TForm4;
Implementation
{$R *.lfm}
Uses ulanguage;
{ TForm4 }
Procedure TForm4.FormCreate(Sender: TObject);
Begin
uccm.RefresStatsMethod := @RefresStatsMethod;
caption := 'Information';
Tform(self).Constraints.MaxHeight := Tform(self).Height;
Tform(self).Constraints.MinHeight := Tform(self).Height;
Tform(self).Constraints.Maxwidth := Tform(self).width;
Tform(self).Constraints.Minwidth := Tform(self).width;
End;
Procedure TForm4.Button1Click(Sender: TObject);
Begin
FAbbrechen := true;
End;
Function TForm4.RefresStatsMethod(Filename: String; Count, Waypoints: integer;
Restart: Boolean): Boolean;
Begin
If Restart Then Begin
FAbbrechen := false;
End;
If (Not form4.Visible) Or Restart Then Begin
(*
* Am Coolsten wäre natürlich wenn dieser Fortschrittsbalken Modal wäre
* das geht aber nicht, denn dann würde das Programm ja stehenbleiben
* So muss also derjenige der das RefresStatsMethod aufruft sich selbst auf
* enabled = false stellen und danach wieder frei schalten
*)
Application.BringToFront;
Form4.Show;
Form4.BringToFront;
Form4.SetFocus;
End;
label2.caption := ExtractFileName(Filename);
label4.caption := inttostr(count);
label6.caption := inttostr(Waypoints);
Application.ProcessMessages;
result := FAbbrechen;
End;
End.