I have a components A(TComponent) and B(TPersistent). B should appear as a
subcomponent of A. I have implemented GetOwner and Assign in B. When I drop
A on a form, the properties of B show up correctly on the properties page in
OI, but the events published in B do not show up on the events page in OI.
What am I missing?
Thanks
Manan
Thanks
Ehsan http://www.delphi7.net
"Manan Patel" <n...@spam.please> wrote in message
news:3ec12567$1...@newsgroups.borland.com...
TmyEvent = procedure(Sender: TObject; MyValue: Boolean) of object;
TClassA = class;
TclassB = class(TPersistent)
private
FCaption: String;
FMyEvent: TMyEvent;
FOwner: TClassA;
protected
function GetOwner: TPersistent; override;
public
constructor Create(AOwner: TClassA);
procedure Assign(Source: TPersistent); override;
published
property Caption: String read FCaption write FCaption;
property MyEvent: TMyEvent read FMyEvent write FMyEvent;
end;
TClassA = class(TComponent)
private
FClassB: TClassB;
procedure SetClassB(Value: TClassB);
published
property ClassB: TClassB read FClassB write SetClassB;
end;
implementation
function TClassB.GetOwner...
begin
Result := FOwner;
end;
function TClassB.Create...
begin
inherited Create;
FOwner := AOWner;
end;
procedure TClassB.Assign...
begin
if Source is TClass B then
with TClassB(Source) do begin
Self.Caption := Caption;
Self.MyEvent := MyEvent;
end
else
inherited;
end;
// I am creating FClassB in Create of TClassA
procedure TClassA.SetClassB...
begin
FClassB.Assign(Value);
end;
// Caption property appears, MyEvent does not.
Thanks
"Ehsan Tabari" <eh...@tabari-home.de> wrote in message
news:3ec1...@newsgroups.borland.com...
--
Robert Cerny
http://codecentral.borland.com/codecentral/ccWeb.exe/author?authorid=18355
"Manan Patel" <n...@spam.please> wrote in message
news:3ec12567$1...@newsgroups.borland.com...
What version of Delphi are you using? This is supported since Delphi 6,
not in 5.
--
Regards,
Peter Thornqvist
(JVCL Coordinator)
http://jvcl.sourceforge.net