⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fibdblogindlg.pas

📁 FIBPlus is a component suite intended for work with InterBase. It is direct, fast and flexible Inter
💻 PAS
字号:
{***************************************************************}
{ 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:gdeatz@hlmdd.com                                    }
{                                                               }
{    Copyright (c) 1998-2007 Devrace Ltd.                       }
{    Written by Serge Buzadzhy (buzz@devrace.com)               }
{                                                               }
{ ------------------------------------------------------------- }
{    FIBPlus home page: http://www.fibplus.com/                 }
{    FIBPlus support  : http://www.devrace.com/support/         }
{ ------------------------------------------------------------- }
{                                                               }
{  Please see the file License.txt for full license information }
{***************************************************************}

unit FIBDBLoginDlg;

interface
{$I FIBPlus.inc}
uses

 {$IFDEF WINDOWS}
  Windows, Messages, SysUtils, Classes,  Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;
 {$ENDIF}
 {$IFDEF LINUX}
  SysUtils, Types, Classes, QControls, QForms, QDialogs,QExtCtrls,
  QStdCtrls;
 {$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.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -