38 |
|
{$ELSE} |
39 |
|
unix, |
40 |
|
{$ENDIF} |
41 |
< |
SysUtils, Classes, Graphics, Controls, |
42 |
< |
Forms, StdCtrls, ExtCtrls, IB, IBDialogs; |
41 |
> |
SysUtils, Classes, Graphics, Controls, Dialogs, |
42 |
> |
Forms, StdCtrls, ExtCtrls, Buttons, IB, IBDialogs; |
43 |
|
|
44 |
|
type |
45 |
– |
|
45 |
|
{ TIBDSLCLInterface } |
46 |
|
|
47 |
|
TIBDSLCLInterface = class(TIBLCLInterface) |
48 |
|
private |
50 |
– |
FSetCursorDepth: integer; |
49 |
|
function GetProjectName: string; |
50 |
|
procedure GetDatabaseName(DefaultDBName, DefaultUserName: string; var DBName: string; |
51 |
|
var UserName: string); |
77 |
|
Bevel1: TBevel; |
78 |
|
Button1: TButton; |
79 |
|
Button2: TButton; |
80 |
+ |
Label1: TLabel; |
81 |
+ |
OpenDialog1: TOpenDialog; |
82 |
|
ProjectName: TLabel; |
83 |
+ |
SpeedButton1: TSpeedButton; |
84 |
|
TargetCaption: TLabel; |
85 |
|
Label2: TLabel; |
86 |
|
Label3: TLabel; |
87 |
|
Password: TEdit; |
88 |
|
UserName: TEdit; |
89 |
|
DatabaseName: TEdit; |
90 |
+ |
procedure SpeedButton1Click(Sender: TObject); |
91 |
|
private |
92 |
|
{ private declarations } |
93 |
|
public |
95 |
|
end; |
96 |
|
|
97 |
|
|
98 |
+ |
{ TIBXDSLoginDlg } |
99 |
+ |
|
100 |
+ |
procedure TIBXDSLoginDlg.SpeedButton1Click(Sender: TObject); |
101 |
+ |
begin |
102 |
+ |
OpenDialog1.InitialDir := ExtractFileDir(DatabaseName.Text); |
103 |
+ |
if OpenDialog1.Execute then |
104 |
+ |
DatabaseName.Text := OpenDialog1.FileName; |
105 |
+ |
end; |
106 |
+ |
|
107 |
+ |
|
108 |
|
function TIBDSLCLInterface.GetProjectName: string; |
109 |
|
begin |
110 |
|
Result := ChangeFileExt(ExtractFileName(LazarusIDE.ActiveProject.MainFile.FileName),''); |
187 |
|
function TIBDSLCLInterface.LoginDialogEx(var ADatabaseName: string; |
188 |
|
var AUserName, APassword: string; NameReadOnly: Boolean): Boolean; |
189 |
|
begin |
190 |
+ |
try |
191 |
|
with TIBXDSLoginDlg.Create(Application) do |
192 |
|
try |
193 |
|
ProjectName.Caption := GetProjectName; |
210 |
|
finally |
211 |
|
Free; |
212 |
|
end; |
213 |
+ |
except On E:Exception do |
214 |
+ |
MessageDlg('Unable to Load Login Dialog ' + E.Message,mtError,[mbOK],0); |
215 |
+ |
end; |
216 |
|
end; |
217 |
|
|
218 |
|
end. |