-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunit4.pas
74 lines (59 loc) · 1.34 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
unit Unit4;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls;
type
{ TUnitDialog }
TUnitDialog = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
Image1: TImage;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure Image1Click(Sender: TObject);
function showUnitDialog():boolean;
private
{ private declarations }
public
{ public declarations }
end;
var
UnitDialog: TUnitDialog;
filename:string;
result:boolean;
implementation
{$R *.lfm}
{ TUnitDialog }
function TUnitDialog.showUnitDialog():boolean;
begin
Visible:=true;
Edit1.Text:='Unit1.pas';
while UnitDialog.Visible do Application.ProcessMessages;
filename:=Edit1.Text;
showUnitDialog:=result;
end;
procedure TUnitDialog.Button1Click(Sender: TObject);
begin
result:=true;
Visible:=false;
end;
procedure TUnitDialog.Button2Click(Sender: TObject);
begin
result:=false;
Visible:=false;
end;
procedure TUnitDialog.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
result:=true;
CanClose:=false;
Visible:=false;
end;
procedure TUnitDialog.Image1Click(Sender: TObject);
begin
end;
end.