1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
unit Saidus;
interface
uses
SysUtils, Classes, DesignEditors, DesignIntf;
type
TSaidusEditor = class(TPropertyEditor)
function GetAttributes: TPropertyAttributes; override;
function GetValue:string;Override;
end;
type
TMyOne = class(TCOmponent)
private
FOneMsg: string;
FxOne: Integer;
FyOne: Integer;
published
property OneMsg: string read FOneMsg write FOneMsg;
property xOne: Integer read FxOne write FxOne;
property yOne: Integer read FyOne write FyOne;
end;
type
TSaidus = class(TComponent)
private
FAskError: Boolean;
FleMessage: string;
FmyOne: TMyOne;
{ Private declarations }
protected
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
property AskError: Boolean read FAskError write FAskError;
property leMessage: string read FleMessage write FleMessage;
property myOne: TMyOne read FmyOne write FmyOne;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('gCom_Saidus', [TSaidus]);
RegisterPropertyEditor( TypeInfo( TMyOne ),TSaidus, 'myOne', TSaidusEditor );
end;
constructor TSaidus.Create(AOwner: TComponent);
begin
inherited;
FmyOne := TMyOne.Create(Self);
// TODO -cMM: TSaidus.Create default body inserted
end;
destructor TSaidus.Destroy;
begin
FreeAndNil(FmyOne);
inherited;
// TODO -cMM: TSaidus.Destroy default body inserted
end;
{ TSaidusEditor }
function TSaidusEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog];
end;
function TSaidusEditor.GetValue: string;
begin
Result := Format( '(%s)', [ GetPropType^.Name ] );
end;
end. |
Partager