📄 mysqllogindlg.pas
字号:
// Author: Jacques Venter, jacques@scibit.com
// Copyright: 1999,2000,2001,2002,2003,2004 SciBit - Scientific Bitware (Pty) Ltd
// Version: 2004.1.1.0
// History: LoginDialog
// 2000.0.1.1
// First release
//
// Licensing
//
// Copyright (c) 1998-2004 SciBit - Scientific Bitware (Pty) Ltd
// ALL RIGHTS RESERVED
//
// The entire contents of this file is protected by South African and
// International Copyright Laws. Unauthorized reproduction,
// reverse-engineering, and distribution of all or any portion of
// the code contained in this file is strictly prohibited and may
// result in severe civil and criminal penalties and will be
// prosecuted to the maximum extent possible under the law.
//
// RESTRICTIONS
//
// THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES
// (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE
// SECRETS OF SCIBIT (Pty) Ltd. THE REGISTERED DEVELOPER IS
// LICENSED TO DISTRIBUTE THE SOURCECODE AND ALL
// ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY.
//
// THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED
// FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE
// COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE
// AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT
// AND PERMISSION FROM SciBit - Scientific Bitware (Pty) Ltd
//
// CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON
// ADDITIONAL RESTRICTIONS.
//
//*******************************************************************
unit MySQLLoginDlg;
interface
{$I product.inc}
uses
SysUtils, Classes,
{$IFDEF MSWINDOWS}
Windows, Controls, Forms, StdCtrls, ExtCtrls, Mask;
{$ELSE}
Qt, QGraphics, QControls, QForms, QStdCtrls, QExtCtrls, QMask;
{$ENDIF}
type
TMySQLLoginDialog = class(TForm)
Panel: TPanel;
Label3: TLabel;
DatabaseName: TEdit;
Label4: TLabel;
Port: TMaskEdit;
Label1: TLabel;
Label2: TLabel;
UserName: TEdit;
Password: TEdit;
Panel2: TPanel;
OKButton: TButton;
CancelButton: TButton;
end;
function MySQLLoginDialog(var ADatabaseName, APort, AUserName, APassword: string): Boolean;
function LoginDialogEx(const ADatabaseName: string;
var AUserName, APassword: string; NameReadOnly: Boolean): Boolean;
function RemoteLoginDialog(var AUserName, APassword: string): Boolean;
implementation
{$IFDEF MSWINDOWS}
{$R *.dfm}
uses Dialogs;
{$ELSE}
{$R *.xfm}
uses QDialogs;
{$ENDIF}
function MySQLLoginDialog(var ADatabaseName, APort, AUserName, APassword: string): Boolean;
begin
with TMySQLLoginDialog.Create(Application) do
try
DatabaseName.Text := ADatabaseName;
Port.Text := APort;
UserName.Text := AUserName;
Result := False;
if ShowModal = mrOk then begin
ADatabaseName := DatabaseName.Text;
APort := Port.Text;
AUserName := UserName.Text;
APassword := Password.Text;
Result := True;
end;
finally
Free;
end;
end;
function LoginDialogEx(const ADatabaseName: string; var AUserName, APassword: string; NameReadOnly: Boolean): Boolean;
begin
with TMySQLLoginDialog.Create(Application) do
try
DatabaseName.Text := ADatabaseName;
UserName.Text := AUserName;
Result := False;
if ShowModal = mrOk then begin
AUserName := UserName.Text;
APassword := Password.Text;
Result := True;
end;
finally
Free;
end;
end;
function RemoteLoginDialog(var AUserName, APassword: string): Boolean;
begin
with TMySQLLoginDialog.Create(Application) do
try
Caption := 'Remote Login';
DatabaseName.Visible := False;
Label3.Visible := False;
UserName.Text := AUserName;
Result := False;
if ShowModal = mrOk then
begin
AUserName := UserName.Text;
APassword := Password.Text;
Result := True;
end;
finally
Free;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -