Article View: comp.lang.pascal.delphi.components.writing
Article #23Streaming a dynamic list of component references
From: dnote
Date: Thu, 17 Dec 1998 00:00
Date: Thu, 17 Dec 1998 00:00
33 lines
1977 bytes
1977 bytes
To all Delphi guru's
I want my component to store a list of component references (on the same or
linked form). To do this the component contains a custom made list class in
which you can add, delete and query the component references. This list
class is derived from TComponent. A pretty silly example of such a component
could be: a TEdit control which stores the references to multiple TFields in
order to react to their events.
Example code:
TMyEdit = class(TCustomEdit) private mFields: TFieldList; ... published {
references are edited through a property editor, the property write specifier
is used to allow delphi-form-streaming to take place. } property Fields:
TFieldList read mFields write SetFields; end;
TFieldList = class(TComponent)
private
mItems: TList; { of TField }
...
public
procedure Add(aField: TField);
...
property Items[aIndex: integer]: TField read GetItems;
end;
Any suggestions on how to do this (an example DefineProperty, Read and Write
sheme would be great)?
Dave de Jong - Dnote Software
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<75b021$iib$1@nnrp1.dejanews.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fe2ce,65c39db2a03ef093,start X-Google-Attributes: gidfe2ce,public X-Google-Thread: 112b07,65c39db2a03ef093,start X-Google-Attributes: gid112b07,public From: dnote@my-dejanews.com Subject: Streaming a dynamic list of component references Date: 1998/12/17 Message-ID: <75b021$iib$1@nnrp1.dejanews.com> X-Deja-AN: 423220789 X-Http-Proxy: 1.0 x12.dejanews.com:80 (Squid/1.1.22) for client 212.61.29.194 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Dec 17 13:13:38 1998 GMT Newsgroups: comp.lang.pascal.delphi.components.writing,borland.public.delphi.vcl.components.writing X-Http-User-Agent: Mozilla/2.0 (compatible; MSIE 3.02; Windows 95)