-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathufrConnect.pas
78 lines (70 loc) · 2 KB
/
ufrConnect.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{****************************************************************
$Id: ufrConnect.pas,v 1.1 2006-03-07 05:35:48 dale Exp $
****************************************************************}
unit ufrConnect;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ConsVarsTypes,
StdCtrls, ExtCtrls;
type
TfrConnect = class(TFrame)
cbNetDirect: TCheckBox;
ePassword: TEdit;
ePort: TEdit;
eServer: TEdit;
eService: TEdit;
eSID: TEdit;
eUserName: TEdit;
gbServer: TGroupBox;
iIcon: TImage;
lPassword: TLabel;
lPort: TLabel;
lServer: TLabel;
lService: TLabel;
lSID: TLabel;
lUserName: TLabel;
pMain: TPanel;
procedure cbNetDirectClick(Sender: TObject);
private
procedure SetConnectParams(const Value: TDBConnectParams);
function GetConnectParams: TDBConnectParams;
public
property ConnectParams: TDBConnectParams read GetConnectParams write SetConnectParams;
end;
implementation
{$R *.dfm}
procedure TfrConnect.cbNetDirectClick(Sender: TObject);
var b: Boolean;
begin
b := cbNetDirect.Checked;
EnableWndCtl(eService, not b);
EnableWndCtl(eServer, b);
EnableWndCtl(ePort, b);
EnableWndCtl(eSID, b);
end;
function TfrConnect.GetConnectParams: TDBConnectParams;
begin
with Result do begin
bNetDirect := cbNetDirect.Checked;
sService := eService.Text;
sServer := eServer.Text;
sPort := ePort.Text;
sSID := eSID.Text;
sUserName := eUserName.Text;
sPassword := ePassword.Text;
end;
end;
procedure TfrConnect.SetConnectParams(const Value: TDBConnectParams);
begin
with Value do begin
cbNetDirect.Checked := bNetDirect;
eService.Text := sService;
eServer.Text := sServer;
ePort.Text := sPort;
eSID.Text := sSID;
eUserName.Text := sUserName;
ePassword.Text := sPassword;
end;
cbNetDirectClick(nil);
end;
end.