Skip to content

TComponentList

List to manage component instances.

Declaration

Source position: contnrs.pp line 104

type

  TComponentList = class(TObjectList)
  public
    destructor Destroy;
    function Add : Integer;
    function Extract : TComponent;
    function Remove : Integer;
    function IndexOf : Integer;
    function First : TComponent;
    function Last : TComponent;
    procedure Insert;
    property Items[Index : Integer]: TComponent; {rw}
  end;

Description

TComponentList is a TObjectList descendent which has as the default array property TComponents instead of objects. It overrides some methods so only components can be added.

In difference with TObjectList, TComponentList removes any TComponent from the list if the TComponent instance was freed externally. It uses the FreeNotification mechanism for this.

Properties

Member Visibility Description
Items public Index-based access to the elements in the list.
See all Properties

Methods

Member Visibility Description
Add public Add a component to the list.
Destroy public Destroys the instance.
Extract public Remove a component from the list without destroying it.
First public First non-nil instance in the list.
IndexOf public Search for an instance in the list.
Insert public Insert a new component in the list.
Last public Last non-nil instance in the list.
Remove public Remove a component from the list, possibly destroying it.
See all Methods

See also

Name Description
#rtl.classes.TList
TFPObjectList TFPList descendent which manages objects.
TObjectList List to manage object instances.
TClassList List of classes.