Wenn es nur darum geht, dem "inneren" Objekt einen Ereignishandler zuzuweisen, kann man den doch einfach durchreichen, oder habe ich das Problem nicht verstanden?
Delphi-Quellcode:
TMyObject = class(TObject)
private
FOnMyEvent: TNotifyEvent;
published
property OnMyEvent: TNotifyEvent read FOnMyEvent write FOnMyEvent;
end;
TMyComponent = class(TComponent)
private
FMyObject: TMyObject;
function GetMyEvent: TNotifyEvent;
procedure SetMyEvent(const Value: TNotifyEvent);
published
property OnMyEvent: TNotifyEvent read GetMyEvent write SetMyEvent;
end;
...
function TMyComponent.GetMyEvent: TNotifyEvent;
begin
Result := FMyObject.OnMyEvent;
end;
procedure TMyComponent.SetMyEvent(const Value: TNotifyEvent);
begin
FMyObject.OnMyEvent := Value;
end;
Aus dem Kopf, daher ungetestet.