//Delphi5
unit NewTest;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, Dialogs, Forms,
dsgnintf;
type
TP = type string;
TAboutProperty = class(TPropertyEditor)
public
procedure Edit;override;
function GetAttributes:TpropertyAttributes;override;
function GetValue:String;override;
end;
TNewTest = class(TControl)
private
FAbout: TP;
{ Private declarations }
protected
{ Protected declarations }
public
constructor Create(AOwner: TComponent);override;
procedure Loaded;override;
{ Public declarations }
published
property About: TP read FAbout write FAbout;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Test', [TNewTest]);
RegisterpropertyEditor(TypeInfo(TP),TNewTest,'About',TAboutproperty);
end;
{ TNewTest }
constructor TNewTest.Create(AOwner: TComponent);
begin
inherited;
end;
procedure TNewTest.Loaded;
begin
inherited;
end;
{ TAboutProperty }
procedure TAboutProperty.Edit;
begin
inherited;
Application.MessageBox('NeTest Version 1.0'+#13+#13+
'This is afreeware component.',
'NeTest 1.0',
MB_OK+MB_ICONINFORMATION);
end;
function TAboutProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paMultiSelect,paDialog,paReadOnly];
end;
function TAboutProperty.GetValue: String;
begin
Result := 'About';
end;
end.