-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLoRaGatewaySettings.pas
64 lines (50 loc) · 1.43 KB
/
LoRaGatewaySettings.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
unit LoRaGatewaySettings;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
SettingsBase, FMX.ScrollBox, FMX.Memo, FMX.Objects, FMX.Controls.Presentation,
FMX.TMSCustomEdit, FMX.TMSEdit, Miscellaneous, Source;
type
TfrmLoRaGatewaySettings = class(TfrmSettingsBase)
Label1: TLabel;
edtHost: TTMSFMXEdit;
Label3: TLabel;
edtPort: TTMSFMXEdit;
procedure FormCreate(Sender: TObject);
procedure edtHostChangeTracking(Sender: TObject);
private
{ Private declarations }
protected
procedure ApplyChanges; override;
procedure CancelChanges; override;
public
{ Public declarations }
end;
var
frmLoRaGatewaySettings: TfrmLoRaGatewaySettings;
implementation
{$R *.fmx}
uses Main;
procedure TfrmLoRaGatewaySettings.ApplyChanges;
begin
SetSettingString(Group, 'Host', edtHost.Text);
SetSettingString(Group, 'Port', edtPort.Text);
inherited;
end;
procedure TfrmLoRaGatewaySettings.CancelChanges;
begin
inherited;
edtHost.Text := GetSettingString(Group, 'Host', '');
edtPort.Text := GetSettingInteger(Group, 'Port', 0).ToString;
end;
procedure TfrmLoRaGatewaySettings.edtHostChangeTracking(Sender: TObject);
begin
SetingsHaveChanged;
end;
procedure TfrmLoRaGatewaySettings.FormCreate(Sender: TObject);
begin
inherited;
Group := 'LoRaGateway';
end;
end.