39 |
|
unix, |
40 |
|
{$ENDIF} |
41 |
|
SysUtils, Classes, Graphics, Controls, |
42 |
< |
Forms, StdCtrls, ExtCtrls, IB; |
42 |
> |
Forms, StdCtrls, ExtCtrls, IB, IBTypes; |
43 |
|
|
44 |
|
type |
45 |
|
|
49 |
|
private |
50 |
|
FSetCursorDepth: integer; |
51 |
|
public |
52 |
< |
function ServerLoginDialog(const AServerName: string; |
53 |
< |
var AUserName, APassword: string): Boolean; |
54 |
< |
function LoginDialogEx(const ADatabaseName: string; |
52 |
> |
function ServerLoginDialog(var AServerName: string; |
53 |
> |
var AUserName, APassword: string): Boolean; virtual; |
54 |
> |
function LoginDialogEx(var ADatabaseName: string; |
55 |
|
var AUserName, APassword: string; |
56 |
< |
NameReadOnly: Boolean): Boolean; |
56 |
> |
NameReadOnly: Boolean): Boolean; virtual; |
57 |
|
procedure SetCursor; |
58 |
|
procedure RestoreCursor; |
59 |
|
end; |
70 |
|
Button1: TButton; |
71 |
|
Button2: TButton; |
72 |
|
DatabaseName: TLabel; |
73 |
< |
Label1: TLabel; |
73 |
> |
TargetCaption: TLabel; |
74 |
|
Label2: TLabel; |
75 |
|
Label3: TLabel; |
76 |
|
Password: TEdit; |
81 |
|
{ public declarations } |
82 |
|
end; |
83 |
|
|
84 |
< |
function TIBLCLInterface.ServerLoginDialog(const AServerName: string; |
85 |
< |
var AUserName, APassword: string): Boolean; |
84 |
> |
function TIBLCLInterface.ServerLoginDialog(var AServerName: string; |
85 |
> |
var AUserName, APassword: string): Boolean; |
86 |
> |
var ActiveForm: TCustomForm; |
87 |
|
begin |
88 |
+ |
ActiveForm := Screen.ActiveCustomForm; |
89 |
|
with TIBXLoginDlg.Create(nil) do |
90 |
|
try |
91 |
|
Caption := 'Firebird Server Login'; |
92 |
< |
Label3.Caption := 'Server Name: '; |
92 |
> |
TargetCaption.Caption := 'Server Name: '; |
93 |
|
DatabaseName.Caption := AServerName; |
94 |
|
UserName.Text := AUserName; |
95 |
|
Result := False; |
103 |
|
finally |
104 |
|
Free; |
105 |
|
end; |
106 |
+ |
if ActiveForm <> nil then |
107 |
+ |
begin |
108 |
+ |
ActiveForm.SetFocus; |
109 |
+ |
Application.ProcessMessages; |
110 |
+ |
end; |
111 |
|
end; |
112 |
|
|
113 |
< |
function TIBLCLInterface.LoginDialogEx(const ADatabaseName: string; |
113 |
> |
function TIBLCLInterface.LoginDialogEx(var ADatabaseName: string; |
114 |
|
var AUserName, APassword: string; NameReadOnly: Boolean): Boolean; |
115 |
+ |
var ActiveForm: TCustomForm; |
116 |
|
begin |
117 |
+ |
ActiveForm := Screen.ActiveCustomForm; |
118 |
|
with TIBXLoginDlg.Create(Application) do |
119 |
|
try |
120 |
|
DatabaseName.Caption := ADatabaseName; |
133 |
|
finally |
134 |
|
Free; |
135 |
|
end; |
136 |
+ |
if ActiveForm <> nil then |
137 |
+ |
begin |
138 |
+ |
ActiveForm.SetFocus; |
139 |
+ |
Application.ProcessMessages; |
140 |
+ |
end; |
141 |
|
end; |
142 |
|
|
143 |
|
procedure TIBLCLInterface.SetCursor; |