It has been a while since I have done this but I am writing a custom component. In that component I have created a sub class to group like properties in the object inspector.
TVirtualExpandProperties = class(TComponent)
private
FImageIndexCollapsed: Integer;
FImageIndexExpanded: Integer;
FImagePosition: TExpandImagePostition;
FImages: TImageList;
FOwnerListview: TCustomVirtualListview;
protected
property OwnerListview: TCustomVirtualListview read FOwnerListview;
public
constructor Create(AOwner: TComponent);
destructor Destroy; override;
published
property Images: TImageList read FImages write FImages;
property ImageIndexExpanded: Integer read FImageIndexExpanded write FImageIndexExpanded;
property ImageIndexCollapsed: Integer read FImageIndexCollapsed write FImageIndexCollapsed;
property ImagePosition: TExpandImagePostition read FImagePosition write FImagePosition;
end;
and in the component I create it and publish it in the TVirtualListview class which is what is installed in the IDE
constructor TCustomVirtualListview.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
.......
FExpandProperties := TVirtualExpandProperties.Create(Self);
ExpandProperties.FOwnerListview := Self;
end;
I also register the class for the streaming system:
initialization
RegisterClass(TVirtualExpandProperties);
end.
It shows up just fine in the object inspector but when I run the program the changed values in this sub-object are back to default and if I show the form as text this component is not being streamed.... What am I missing.
Thanks,
Jim