--- ibx/trunk/design/IBDSDialogs.pas 2016/09/22 17:10:15 44 +++ ibx/trunk/design/IBDSDialogs.pas 2016/12/06 10:33:46 45 @@ -38,16 +38,14 @@ uses {$ELSE} unix, {$ENDIF} - SysUtils, Classes, Graphics, Controls, - Forms, StdCtrls, ExtCtrls, IB, IBDialogs; + SysUtils, Classes, Graphics, Controls, Dialogs, + Forms, StdCtrls, ExtCtrls, Buttons, IB, IBDialogs; type - { TIBDSLCLInterface } TIBDSLCLInterface = class(TIBLCLInterface) private - FSetCursorDepth: integer; function GetProjectName: string; procedure GetDatabaseName(DefaultDBName, DefaultUserName: string; var DBName: string; var UserName: string); @@ -79,13 +77,17 @@ type Bevel1: TBevel; Button1: TButton; Button2: TButton; + Label1: TLabel; + OpenDialog1: TOpenDialog; ProjectName: TLabel; + SpeedButton1: TSpeedButton; TargetCaption: TLabel; Label2: TLabel; Label3: TLabel; Password: TEdit; UserName: TEdit; DatabaseName: TEdit; + procedure SpeedButton1Click(Sender: TObject); private { private declarations } public @@ -93,6 +95,16 @@ type end; +{ TIBXDSLoginDlg } + +procedure TIBXDSLoginDlg.SpeedButton1Click(Sender: TObject); +begin + OpenDialog1.InitialDir := ExtractFileDir(DatabaseName.Text); + if OpenDialog1.Execute then + DatabaseName.Text := OpenDialog1.FileName; +end; + + function TIBDSLCLInterface.GetProjectName: string; begin Result := ChangeFileExt(ExtractFileName(LazarusIDE.ActiveProject.MainFile.FileName),''); @@ -175,6 +187,7 @@ end; function TIBDSLCLInterface.LoginDialogEx(var ADatabaseName: string; var AUserName, APassword: string; NameReadOnly: Boolean): Boolean; begin + try with TIBXDSLoginDlg.Create(Application) do try ProjectName.Caption := GetProjectName; @@ -197,6 +210,9 @@ begin finally Free; end; + except On E:Exception do + MessageDlg('Unable to Load Login Dialog ' + E.Message,mtError,[mbOK],0); + end; end; end.