unit TcpExportSvrProp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, rpTcpServer;

type
  TTcpExportSvrPropForm = class(TForm)
    GroupBox1: TGroupBox;                    
    cbEnable: TCheckBox;
    btOk: TButton;
    btCancel: TButton;
    edPort: TEdit;
    Label2: TLabel;
    Label1: TLabel;
    edMaxClients: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure btOkClick(Sender: TObject);
  private
    { Private declarations }
  public
    P: TTcpExportSvr;
  end;


implementation

//uses
//  rpTcpGlobals;

{$R *.dfm}

procedure TTcpExportSvrPropForm.FormCreate(Sender: TObject);
begin
  P := nil;
end;

procedure TTcpExportSvrPropForm.FormActivate(Sender: TObject);
begin
  if P = nil then exit;

  cbEnable.Checked := P.Enable;
  edPort.Text := inttostr(P.Port);
  edMaxClients.Text := inttostr(P.MaxClients);
end;

procedure TTcpExportSvrPropForm.btOkClick(Sender: TObject);
var
  i,v: integer;
begin
  P.Enable := cbEnable.Checked;

  val(edMaxClients.Text, v, i);
  P.MaxClients := v;

  val(edPort.Text, v, i);
  P.Port := v;

  ModalResult := mrOk;
end;

end.
