home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 January
/
Chip_1999-01_cd.bin
/
zkuste
/
delphi
/
QDB
/
QDB.ZIP
/
qdbreg.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-01-06
|
1KB
|
57 lines
unit qdbreg;
interface
procedure Register;
implementation
uses
SysUtils, Classes, Dialogs, Forms, DsgnIntf, TypInfo,
QDB, QDBU;
const
SFilter = 'QDB files (*.QDB)|*.QDB|Any Files (*.*)|*.*';
{$IFDEF WIN32}
{$R QDBREG.R32}
{$ELSE}
{$R QDBREG.R16}
{$ENDIF}
type
TQDBFilenameProperty = class(TStringProperty)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
end;
procedure TQDBFilenameProperty.Edit;
var
QDBFileOpen: TOpenDialog;
begin
QDBFileOpen:=TOpenDialog.Create(Application);
QDBFileOpen.Filename:=GetValue;
QDBFileOpen.Filter:=SFilter;
QDBFileOpen.HelpContext:=0;
QDBFileOpen.Options:=[ofPathMustExist];
try
if QDBFileOpen.Execute then SetValue(QDBFileOpen.Filename);
finally
QDBFileOpen.Free;
end;
end;
function TQDBFilenameProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog{$IFDEF WIN32}, paRevertable{$ENDIF}];
end;
procedure Register;
begin
RegisterComponents('IHSoftware', [TQDB, TQDBNavigator]);
RegisterPropertyEditor(TypeInfo(TQDBFileName), TQDB, 'FileName', TQDBFileNameProperty);
end;
end.