ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/dblogindlg.pas
Revision: 7
Committed: Sun Aug 5 18:28:19 2012 UTC (11 years, 7 months ago) by tony
Content type: text/x-pascal
File size: 2090 byte(s)
Log Message:
Committing updates for Release R1-0-0

File Contents

# User Rev Content
1 tony 7 (*
2     * IBX For Lazarus (Firebird Express)
3     *
4     * The contents of this file are subject to the Initial Developer's
5     * Public License Version 1.0 (the "License"); you may not use this
6     * file except in compliance with the License. You may obtain a copy
7     * of the License here:
8     *
9     * http://www.firebirdsql.org/index.php?op=doc&id=idpl
10     *
11     * Software distributed under the License is distributed on an "AS
12     * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13     * implied. See the License for the specific language governing rights
14     * and limitations under the License.
15     *
16     * The Initial Developer of the Original Code is Tony Whyman.
17     *
18     * The Original Code is (C) 2011 Tony Whyman, MWA Software
19     * (http://www.mwasoftware.co.uk).
20     *
21     * All Rights Reserved.
22     *
23     * Contributor(s): ______________________________________.
24     *
25     *)
26    
27 tony 5 unit dblogindlg;
28    
29     {$mode objfpc}{$H+}
30    
31     interface
32    
33     uses
34     Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
35     ExtCtrls, StdCtrls;
36    
37     type
38    
39 tony 7 { TIBXLoginDlg }
40 tony 5
41 tony 7 TIBXLoginDlg = class(TForm)
42 tony 5 Bevel1: TBevel;
43     Button1: TButton;
44     Button2: TButton;
45     DatabaseName: TLabel;
46     Label1: TLabel;
47     Label2: TLabel;
48     Label3: TLabel;
49     Password: TEdit;
50     UserName: TEdit;
51     private
52     { private declarations }
53     public
54     { public declarations }
55     end;
56    
57     function LoginDialogEx(const ADatabaseName: string;
58     var AUserName, APassword: string; NameReadOnly: Boolean): Boolean;
59     var
60 tony 7 IBXLoginDlg: TIBXLoginDlg;
61 tony 5
62     implementation
63    
64 tony 7 {$R *.lfm}
65    
66 tony 5 function LoginDialogEx(const ADatabaseName: string;
67     var AUserName, APassword: string; NameReadOnly: Boolean): Boolean;
68     begin
69 tony 7 with TIBXLoginDlg.Create(Application) do
70 tony 5 try
71     DatabaseName.Caption := ADatabaseName;
72     UserName.Text := AUserName;
73     Result := False;
74     if NameReadOnly then
75     UserName.Enabled := False
76     else
77     if AUserName = '' then ActiveControl := UserName;
78     if ShowModal = mrOk then
79     begin
80     AUserName := UserName.Text;
81     APassword := Password.Text;
82     Result := True;
83 tony 7 end
84 tony 5 finally
85     Free;
86     end;
87     end;
88    
89    
90     end.
91