-




TUUCode, FileName (InputFile), . UUReg, TUUCode .

unit UUReg;

interface

{$IFDEF WIN32}

{$R UUCODE.D32}

{$ELSE}

{$R UUCODE.D16}

{$ENDIF}

uses

DsgnIntf;

type

TFileNameProperty = class(TStringProperty)

public

function

GetAttributes: TPropertyAttributes; override;

procedure

Edit; override;

end;

procedure

Register;

implementation

uses

UUCode, Classes, Dialogs, Forms, SysUtils;

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};

procedure

Register;

begin

{ component }

RegisterComponents('DrBob42', [TUUCode]);

{ property editor }

RegisterPropertyEditor(TypeInfo(TFilename), nil,

'InputFile', TFilenameProperty);

end {Register};

end.

TUUCode , , UUCode (runtime package), UUReg (design-time), . , UUCode Wizard IDE Delphi !