-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMyViewForm.pas
58 lines (45 loc) · 1021 Bytes
/
MyViewForm.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
unit MyViewForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
MyViewIntf, MyPresenter;
type
TForm1 = class(TForm, IMyView)
Button1: TButton;
Edit1: TEdit;
procedure Edit1Change(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
FPresenter: TMyPresenter;
public
procedure EnableSubmit;
procedure DisableSubmit;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormDestroy(Sender: TObject);
begin
FPresenter.Destroy;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FPresenter := TMyPresenter.Create(Self);
end;
{ TForm1 }
procedure TForm1.DisableSubmit;
begin
Button1.Enabled := False;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
FPresenter.Text := Edit1.Text;
end;
procedure TForm1.EnableSubmit;
begin
Button1.Enabled := True;
end;
end.