[Overview][Types][Classes][Procedures and functions] Reference for unit 'contnrs' (#fcl)

TComponentList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

List to manage component instances.

Declaration

Source position: contnrs.pp line 94

type TComponentList = class(TObjectList)

public

  destructor Destroy; override;

  

Destroys the instance

  function Add();

  

Add a component to the list.

  function Extract();

  

Remove a component from the list without destroying it.

  function Remove();

  

Remove a component from the list, possibly destroying it.

  function IndexOf();

  

Search for an instance in the list

  function First;

  

First non-nil instance in the list.

  function Last;

  

Last non-nil instance in the list.

  procedure Insert();

  

Insert a new component in the list

  property Items: TComponent; default; [rw]

  

Index-based access to the elements in the list.

end;

Inheritance

TComponentList

  

List to manage component instances.

|

TObjectList

  

List to manage object instances.

|

TList

|

TObject

Description

TComponentListis a TObjectListdescendent which has as the default array property TComponentsinstead of objects. It overrides some methods so only components can be added.

In difference with TObjectList, TComponentListremoves any TComponentfrom the list if the TComponentinstance was freed externally. It uses the FreeNotificationmechanism for this.

See also

#rtl.classes.TList

TFPObjectList

  

TFPListdescendent which manages objects.

TObjectList

  

List to manage object instances.

TClassList

  

List of classes.