-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDPM.Creator.OptionsForm.pas
86 lines (74 loc) · 1.78 KB
/
DPM.Creator.OptionsForm.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
unit DPM.Creator.OptionsForm;
interface
uses
Winapi.Windows,
Winapi.Messages,
System.SysUtils,
System.Variants,
System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls,
Vcl.ExtCtrls,
DPM.Core.Types,
DPM.Core.Logging,
DPM.IDE.AddInOptionsFrame,
DPM.Core.Configuration.Interfaces,
DPM.Core.Configuration.Manager,
DPM.IDE.Options,
DPM.Creator.FakeIDEOptions
;
type
TOptionsForm = class(TForm)
DPMOptionsFrame: TDPMOptionsFrame;
Panel1: TPanel;
btnCancel: TButton;
btnOk: TButton;
procedure btnCancelClick(Sender: TObject);
procedure btnOkClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
FConfigManager : IConfigurationManager;
FLogger: ILogger;
FIDEOptions : IDPMIDEOptions;
public
{ Public declarations }
constructor Create(AOwner: TComponent; logger: ILogger); reintroduce;
end;
implementation
{$R *.dfm}
constructor TOptionsForm.Create(AOwner: TComponent; logger: ILogger);
begin
inherited Create(AOwner);
FLogger := logger;
FIDEOptions := TFakeIDE.Create;
end;
procedure TOptionsForm.btnCancelClick(Sender: TObject);
begin
Close;
Self.ModalResult := mrCancel;
end;
procedure TOptionsForm.btnOkClick(Sender: TObject);
begin
if DPMOptionsFrame.Validate then
begin
DPMOptionsFrame.SaveSettings;
Close;
Self.ModalResult := mrOK;
end;
end;
procedure TOptionsForm.FormCreate(Sender: TObject);
begin
FConfigManager := TConfigurationManager.Create(FLogger);
DPMOptionsFrame.Configure(FConfigManager, FIDEOptions, FLogger, '');
DPMOptionsFrame.LoadSettings;
end;
procedure TOptionsForm.FormShow(Sender: TObject);
begin
DPMOptionsFrame.tsIDEOptions.Visible := False;
end;
end.