mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 10:39:15 +02:00
Registered property editor for IBConnection databasebae
git-svn-id: trunk@12563 -
This commit is contained in:
parent
4480d1ed60
commit
5dc1767859
@ -60,6 +60,7 @@ uses
|
||||
sqlite3conn,
|
||||
{$ENDIF}
|
||||
mysql50conn,
|
||||
propedits,
|
||||
LazarusPackageIntf;
|
||||
|
||||
procedure Register;
|
||||
@ -92,8 +93,38 @@ begin
|
||||
TIBConnection]);
|
||||
end;
|
||||
|
||||
Type
|
||||
TSQLFirebirdFileNamePropertyEditor=class(TFileNamePropertyEditor)
|
||||
protected
|
||||
function GetFilter: String; override;
|
||||
function GetInitialDirectory: string; override;
|
||||
end;
|
||||
|
||||
Resourcestring
|
||||
SFireBirdDatabases = 'Firebird databases';
|
||||
SInterbaseDatabases = 'Interbase databases';
|
||||
|
||||
{ TDbfFileNamePropertyEditor }
|
||||
|
||||
function TSQLFirebirdFileNamePropertyEditor.GetFilter: String;
|
||||
begin
|
||||
Result := sFireBirdDatabases+' (*.fb)|*.fb;*.fdb';
|
||||
Result := Result + sInterbaseDatabases +' (*.gdb)|*.gdb;*.GDB';
|
||||
Result:= Result+ '|'+ inherited GetFilter;
|
||||
end;
|
||||
|
||||
function TSQLFirebirdFileNamePropertyEditor.GetInitialDirectory: string;
|
||||
begin
|
||||
Result:= (GetComponent(0) as TSQLConnection).DatabaseName;
|
||||
Result:= ExtractFilePath(Result);
|
||||
end;
|
||||
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterPropertyEditor(TypeInfo(AnsiString),
|
||||
TIBConnection, 'DatabaseName', TSQLFirebirdFileNamePropertyEditor);
|
||||
|
||||
RegisterUnit('sqldb',@RegisterUnitSQLdb);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user