source: trunk/Forms/FormServer.pas

Last change on this file was 325, checked in by chronos, 7 months ago
  • Fixed: Size of buttons was too small in some cases.
File size: 1.3 KB
Line 
1unit FormServer;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
7 Spin, ServerList, FormEx;
8
9type
10
11 { TFormServer }
12
13 TFormServer = class(TFormEx)
14 ButtonCancel: TButton;
15 ButtonOk: TButton;
16 EditAddress: TEdit;
17 EditName: TEdit;
18 Label1: TLabel;
19 Label2: TLabel;
20 Label3: TLabel;
21 ScrollBox1: TScrollBox;
22 SpinEdit1: TSpinEdit;
23 procedure ButtonOkClick(Sender: TObject);
24 private
25 FServerInfo: TServerInfo;
26 procedure SetServerInfo(AValue: TServerInfo);
27 procedure Load(Server: TServerInfo);
28 procedure Save(Server: TServerInfo);
29 public
30 property ServerInfo: TServerInfo read FServerInfo write SetServerInfo;
31 end;
32
33
34implementation
35
36{$R *.lfm}
37
38{ TFormServer }
39
40procedure TFormServer.ButtonOkClick(Sender: TObject);
41begin
42 Save(FServerInfo);
43end;
44
45procedure TFormServer.SetServerInfo(AValue: TServerInfo);
46begin
47 if FServerInfo = AValue then Exit;
48 FServerInfo := AValue;
49 if Assigned(FServerInfo) then Load(FServerInfo);
50end;
51
52procedure TFormServer.Load(Server: TServerInfo);
53begin
54 EditName.Text := Server.Name;
55 EditAddress.Text := Server.Address;
56 SpinEdit1.Value := Server.Port;
57end;
58
59procedure TFormServer.Save(Server: TServerInfo);
60begin
61 Server.Name := EditName.Text;
62 Server.Address := EditAddress.Text;
63 Server.Port := SpinEdit1.Value;
64end;
65
66end.
67
Note: See TracBrowser for help on using the repository browser.