-
Notifications
You must be signed in to change notification settings - Fork 58
/
FIBDBLoginDlg.pas
106 lines (92 loc) · 3.17 KB
/
FIBDBLoginDlg.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{***************************************************************}
{ FIBPlus - component library for direct access to Firebird and }
{ InterBase databases }
{ }
{ FIBPlus is based in part on the product }
{ Free IB Components, written by Gregory H. Deatz for }
{ Hoagland, Longo, Moran, Dunst & Doukas Company. }
{ mailto:[email protected] }
{ }
{ Copyright (c) 1998-2007 Devrace Ltd. }
{ Written by Serge Buzadzhy ([email protected]) }
{ }
{ ------------------------------------------------------------- }
{ FIBPlus home page: http://www.fibplus.com/ }
{ FIBPlus support : http://www.devrace.com/support/ }
{ ------------------------------------------------------------- }
{ }
{ Please see the file License.txt for full license information }
{***************************************************************}
{$I FIBPlus.inc}
unit FIBDBLoginDlg;
interface
uses {$IFDEF D_XE2}Vcl.StdCtrls, Vcl.Controls,
System.Classes, Vcl.Forms,Vcl.Dialogs,Vcl.ExtCtrls,
{$ENDIF}
SysUtils{$IFNDEF D_XE2}, Forms, Classes, Controls,
StdCtrls, ExtCtrls,Dialogs{$ENDIF};
type
TfrmFIBDBLoginDlg = class(TForm)
Bevel1: TBevel;
Label1: TLabel;
lbDBName: TLabel;
Bevel2: TBevel;
Button1: TButton;
Button2: TButton;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
EdUserName: TEdit;
EdPassword: TEdit;
EdRole: TEdit;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function pFIBLoginDialogEx(const ADatabaseName: string; var AUserName, APassword,ARoleName: string): Boolean;
implementation
{$R *.dfm}
uses fib, FIBConsts;
function pFIBLoginDialogEx(const ADatabaseName: string;
var AUserName, APassword,ARoleName: string
): Boolean;
var frmFIBDBLoginDlg: TfrmFIBDBLoginDlg;
begin
frmFIBDBLoginDlg:= TfrmFIBDBLoginDlg.Create(nil);
with frmFIBDBLoginDlg do
try
if Length(ADatabaseName)<=45 then
lbDBName.Caption:= ADatabaseName
else
lbDBName.Caption:=Copy(ADatabaseName,1,10)+'...'+
Copy(ADatabaseName,Length(ADatabaseName)-32,MaxInt);
EdUserName.Text := AUserName;
EdRole .Text := ARoleName;
Result:= ShowModal=mrOk;
if Result then
begin
AUserName := EdUserName.Text;
ARoleName := EdRole .Text;
APassword := EdPassword.Text;
end;
finally
Free;
end
end;
procedure TfrmFIBDBLoginDlg.FormCreate(Sender: TObject);
begin
Caption := SLoginDlgLoginCaption;
Label1.Caption := SLoginDlgDatabase;
Label2.Caption := SDBEditUserName;
Label3.Caption := SDBEditPassword;
Label4.Caption := SDBEditSQLRole;
Button1.Caption := SOKButton;
Button2.Caption := SCancelButton;
end;
initialization
pFIBLoginDialog :=pFIBLoginDialogEx;
finalization
pFIBLoginDialog :=nil
end.