home *** CD-ROM | disk | FTP | other *** search
- unit qdbreg;
-
- interface
-
- procedure Register;
-
- implementation
-
- uses
- SysUtils, Classes, Dialogs, Forms, DsgnIntf, QDB, QDBPanel;
-
- 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,TQDBPanel]);
- RegisterPropertyEditor(TypeInfo(TQDBFileName), TQDB, 'FileName', TQDBFileNameProperty);
- end;
-
- end.
-