-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathTCPSettings.pas
More file actions
77 lines (60 loc) · 1.75 KB
/
Copy pathTCPSettings.pas
File metadata and controls
77 lines (60 loc) · 1.75 KB
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
unit TCPSettings;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, SettingsForm, AdvSmoothButton,
AdvOfficeButtons, Vcl.StdCtrls, Vcl.ExtCtrls, AdvPanel, Miscellaneous;
type
TfrmTCPSettings = class(TfrmSettings)
Label1: TLabel;
edtHost: TEdit;
Label2: TLabel;
edtPort: TEdit;
chkUpload: TAdvOfficeCheckBox;
procedure edtHostChange(Sender: TObject);
private
{ Private declarations }
protected
procedure ApplyChanges; override;
procedure LoadFields; override;
procedure SaveFields; override;
public
{ Public declarations }
end;
implementation
{$R *.dfm}
uses Data, Misc;
procedure TfrmTCPSettings.ApplyChanges;
begin
// Send settings to source
SetSettingString(Group, 'Host', edtHost.Text);
SetSettingInteger(Group, 'Port', StrToIntDef(edtPort.Text, 0));
// Tell source things have changed
inherited;
end;
procedure TfrmTCPSettings.edtHostChange(Sender: TObject);
begin
btnSave.Enabled := True;
end;
procedure TfrmTCPSettings.LoadFields;
var
Settings: String;
begin
inherited;
with DataModule1.tblSources do begin
edtHost.Text := FieldByName('Host').AsString;
edtPort.Text := FieldByName('Port').AsString;
Settings := ';' + FieldByName('Settings').AsString;
chkUpload.Checked := GetBooleanSetting('Upload', Settings);
end;
end;
procedure TfrmTCPSettings.SaveFields;
begin
inherited;
with DataModule1.tblSources do begin
FieldByName('Host').AsString := edtHost.Text;
FieldByName('Port').AsString := edtPort.Text;
FieldByName('Settings').AsString := 'Upload=' + BoolToStr(chkUpload.Checked, True);
end;
end;
end.