TCollectionItem
[Properties (by Name)][Methods (by Name)][Events (by Name)]
Basic object that is managed by a TCollection class.
Declaration
Source position: classesh.inc line 484
Type
TCollectionItem = class (TPersistent)
private
FCollection : TCollection;
FID : Integer;
FUpdateCount : Integer;
function GetIndex : Integer;
protected
procedure SetCollection(Value: TCollection); Virtual;
procedure Changed(AllItems: Boolean);
function GetOwner : TPersistent; Override;
function GetDisplayName : string; Virtual;
procedure SetIndex(Value: Integer); Virtual;
procedure SetDisplayName(const Value: string); Virtual;
UpdateCount : Integer;
public
constructor Create(ACollection: TCollection); Virtual;
destructor Destroy; Override;
function GetNamePath : string; Override;
Collection : TCollection;
ID : Integer;
Index : Integer;
DisplayName : string;
end
;
Description
TCollectionItem and TCollection form a pair of base classes that manage a collection of named objects. The TCollectionItem is the named object that is managed, it represents one item in the collection. An item in the collection is represented by three properties: TCollectionItem.DisplayName , TCollection.Index]() and TCollectionItem.ID .
A TCollectionItem object is never created directly. To manage a set of named items, it is necessary to make a descendant of TCollectionItem to which needed properties and methods are added. This descendant can then be managed with a TCollection class. The managing collection will create and destroy it's items by itself, it should therefore never be necessary to create TCollectionItem descendants manually.
Members
| Member | Type | Visibility | Description |
|---|---|---|---|
| Changed | Method | protected | Method to notify the managing collection that the name or index of this item has changed. |
| Collection | Property | public | Pointer to the collection managing this item. |
| Create | Method | public | Creates a new instance of this collection item. |
| Destroy | Method | public | Destroys this collection item. |
| DisplayName | Property | public | Name of the item, displayed in the object inspector. |
| FCollection | Field | private | |
| FID | Field | private | |
| FUpdateCount | Field | private | |
| GetDisplayName | Method | protected | Returns the TCollectionItem.DisplayName of the collectionitem |
| GetIndex | Method | private | |
| GetNamePath | Method | public | Returns the namepath of this collection item. |
| GetOwner | Method | protected | Returns the managing collection. |
| ID | Property | public | Initial index of this item. |
| Index | Property | public | Index of the item in its managing collection TCollection.Items property. |
| SetCollection | Method | protected | |
| SetDisplayName | Method | protected | Write method for the TCollectionItem.DisplayName property |
| SetIndex | Method | protected | Write method for the TCollectionItem.Index property. |
| UpdateCount | Property | protected |
Inheritance
| Class | Description |
|---|---|
| TCollectionItem | Basic object that is managed by a TCollection class. |
See also
| Name | Description |
|---|---|
| Integer | A signed 16-bits integer |
| Integer | A signed 16-bits integer |
| Integer | A signed 16-bits integer |
| Integer | A signed 16-bits integer |
| Integer | A signed 16-bits integer |
| TCollection | Base class to manage collections of named objects. |
| TCollection | Base class to manage collections of named objects. |
| TCollection | Base class to manage collections of named objects. |