|
Last change
on this file was 325, checked in by chronos, 17 months ago |
- Fixed: Size of buttons was too small in some cases.
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | unit FormServer;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
|---|
| 7 | Spin, ServerList, FormEx;
|
|---|
| 8 |
|
|---|
| 9 | type
|
|---|
| 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 |
|
|---|
| 34 | implementation
|
|---|
| 35 |
|
|---|
| 36 | {$R *.lfm}
|
|---|
| 37 |
|
|---|
| 38 | { TFormServer }
|
|---|
| 39 |
|
|---|
| 40 | procedure TFormServer.ButtonOkClick(Sender: TObject);
|
|---|
| 41 | begin
|
|---|
| 42 | Save(FServerInfo);
|
|---|
| 43 | end;
|
|---|
| 44 |
|
|---|
| 45 | procedure TFormServer.SetServerInfo(AValue: TServerInfo);
|
|---|
| 46 | begin
|
|---|
| 47 | if FServerInfo = AValue then Exit;
|
|---|
| 48 | FServerInfo := AValue;
|
|---|
| 49 | if Assigned(FServerInfo) then Load(FServerInfo);
|
|---|
| 50 | end;
|
|---|
| 51 |
|
|---|
| 52 | procedure TFormServer.Load(Server: TServerInfo);
|
|---|
| 53 | begin
|
|---|
| 54 | EditName.Text := Server.Name;
|
|---|
| 55 | EditAddress.Text := Server.Address;
|
|---|
| 56 | SpinEdit1.Value := Server.Port;
|
|---|
| 57 | end;
|
|---|
| 58 |
|
|---|
| 59 | procedure TFormServer.Save(Server: TServerInfo);
|
|---|
| 60 | begin
|
|---|
| 61 | Server.Name := EditName.Text;
|
|---|
| 62 | Server.Address := EditAddress.Text;
|
|---|
| 63 | Server.Port := SpinEdit1.Value;
|
|---|
| 64 | end;
|
|---|
| 65 |
|
|---|
| 66 | end.
|
|---|
| 67 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.