-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunit2.pas
54 lines (37 loc) · 848 Bytes
/
unit2.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
unit Unit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Unit1;
type
{ TForm2 }
TForm2 = class(TForm)
Button1: TButton;
Label3: TLabel;
port: TEdit;
url: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
public
end;
var
Form2: TForm2;
implementation
{$R *.lfm}
{ TForm2 }
procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.jsonprop.StoredValue['port'] := port.Text;
Form1.jsonprop.StoredValue['url'] := url.Text;
Form1.jsonprop.Save;
Form2.Hide;
end;
procedure TForm2.FormShow(Sender: TObject);
begin
port.Text := Form1.jsonprop.ReadInteger('port', 4444).ToString;
url.Text := Form1.jsonprop.ReadString('url', '127.0.0.1');
end;
end.