home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 January
/
Chip_1999-01_cd.bin
/
zkuste
/
delphi
/
D1
/
DRBOBC.ZIP
/
FILENAME.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-01-12
|
809b
|
34 lines
unit FileName;
interface
uses DsgnIntf;
Type
TFileNameProperty = class(TStringProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure Edit; override;
end;
implementation
uses Dialogs, Forms;
function TFileNameProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog]
end {GetAttributes};
procedure TFileNameProperty.Edit;
begin
with TOpenDialog.Create(Application) do
try
Title := GetName; { name of property as OpenDialog caption }
Filename := GetValue;
Filter := 'All Files (*.*)|*.*';
HelpContext := 0;
Options := Options + [ofShowHelp, ofPathMustExist, ofFileMustExist];
if Execute then SetValue(Filename);
finally
Free
end
end {Edit};
end.