--- ibx/trunk/runtime/dblogindlg.pas 2013/02/28 16:56:14 16 +++ ibx/trunk/runtime/dblogindlg.pas 2013/12/28 19:22:24 17 @@ -1,91 +1,91 @@ -(* - * IBX For Lazarus (Firebird Express) - * - * The contents of this file are subject to the Initial Developer's - * Public License Version 1.0 (the "License"); you may not use this - * file except in compliance with the License. You may obtain a copy - * of the License here: - * - * http://www.firebirdsql.org/index.php?op=doc&id=idpl - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing rights - * and limitations under the License. - * - * The Initial Developer of the Original Code is Tony Whyman. - * - * The Original Code is (C) 2011 Tony Whyman, MWA Software - * (http://www.mwasoftware.co.uk). - * - * All Rights Reserved. - * - * Contributor(s): ______________________________________. - * -*) - -unit dblogindlg; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, - ExtCtrls, StdCtrls; - -type - - { TIBXLoginDlg } - - TIBXLoginDlg = class(TForm) - Bevel1: TBevel; - Button1: TButton; - Button2: TButton; - DatabaseName: TLabel; - Label1: TLabel; - Label2: TLabel; - Label3: TLabel; - Password: TEdit; - UserName: TEdit; - private - { private declarations } - public - { public declarations } - end; - -function LoginDialogEx(const ADatabaseName: string; - var AUserName, APassword: string; NameReadOnly: Boolean): Boolean; -var - IBXLoginDlg: TIBXLoginDlg; - -implementation - -{$R *.lfm} - -function LoginDialogEx(const ADatabaseName: string; - var AUserName, APassword: string; NameReadOnly: Boolean): Boolean; -begin - with TIBXLoginDlg.Create(Application) do - try - DatabaseName.Caption := ADatabaseName; - UserName.Text := AUserName; - Result := False; - if NameReadOnly then - UserName.Enabled := False - else - if AUserName = '' then ActiveControl := UserName; - if ShowModal = mrOk then - begin - AUserName := UserName.Text; - APassword := Password.Text; - Result := True; - end - finally - Free; - end; -end; - - -end. - +(* + * IBX For Lazarus (Firebird Express) + * + * The contents of this file are subject to the Initial Developer's + * Public License Version 1.0 (the "License"); you may not use this + * file except in compliance with the License. You may obtain a copy + * of the License here: + * + * http://www.firebirdsql.org/index.php?op=doc&id=idpl + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing rights + * and limitations under the License. + * + * The Initial Developer of the Original Code is Tony Whyman. + * + * The Original Code is (C) 2011 Tony Whyman, MWA Software + * (http://www.mwasoftware.co.uk). + * + * All Rights Reserved. + * + * Contributor(s): ______________________________________. + * +*) + +unit dblogindlg; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + ExtCtrls, StdCtrls; + +type + + { TIBXLoginDlg } + + TIBXLoginDlg = class(TForm) + Bevel1: TBevel; + Button1: TButton; + Button2: TButton; + DatabaseName: TLabel; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Password: TEdit; + UserName: TEdit; + private + { private declarations } + public + { public declarations } + end; + +function LoginDialogEx(const ADatabaseName: string; + var AUserName, APassword: string; NameReadOnly: Boolean): Boolean; +var + IBXLoginDlg: TIBXLoginDlg; + +implementation + +{$R *.lfm} + +function LoginDialogEx(const ADatabaseName: string; + var AUserName, APassword: string; NameReadOnly: Boolean): Boolean; +begin + with TIBXLoginDlg.Create(Application) do + try + DatabaseName.Caption := ADatabaseName; + UserName.Text := AUserName; + Result := False; + if NameReadOnly then + UserName.Enabled := False + else + if AUserName = '' then ActiveControl := UserName; + if ShowModal = mrOk then + begin + AUserName := UserName.Text; + APassword := Password.Text; + Result := True; + end + finally + Free; + end; +end; + + +end. +