cadetill's blog Copyright © Xavier Martínez (cadetill)

Class TGMInterfacedCollection

Unit

Declaration

type TGMInterfacedCollection = class(TCollection, IGMControlChanges, IGMOwnerLang, IGMToStr)

Description

Base class for all classes that inherit from TCollection into GMLib.

Implements IGMControlChanges, IGMToStr and IGMOwnerLang interfaces.

Hierarchy

Overview

Methods

Public constructor Create(AOwner: TPersistent; ItemClass: TCollectionItemClass); virtual;
Protected function GetOwner: TPersistent; override;
Protected function GetOwnerLang: TGMLang; virtual;
Protected function PropToString: string; virtual;
Public procedure Assign(Source: TPersistent); override;
Protected procedure Clear;
Protected procedure Delete(Index: Integer);
Protected procedure Move(CurIndex, NewIndex: Integer);
Protected procedure PropertyChanged(Prop: TPersistent; PropName: string);

Properties

Protected property Items[I:Integer]: TGMInterfacedCollectionItem read GetItems write SetItems;
Protected property OnChange: TNotifyEvent read FOnChange write FOnChange;

Description

Methods

Public constructor Create(AOwner: TPersistent; ItemClass: TCollectionItemClass); virtual;

Class constructor.

Parameters
AOwner
Object owner.
ItemClass
Identifies the TCollectionItem descendants that must be used to represent the items in the collection.
Protected function GetOwner: TPersistent; override;

Function that return the object owner.

Returns

Owner of object

Protected function GetOwnerLang: TGMLang; virtual;

Returns the TGMLang of the Owner.

If Owner is not assigned or not supports IGMOwnerLang interface then should be returned lnEnglish.

Returns

TGMLang of the owner object.

Protected function PropToString: string; virtual;

Converts all class properties values to a string separated by comma used to send values to a JavaScript function.

Returns

string with all properties.

Public procedure Assign(Source: TPersistent); override;

Call Assign to copy the properties or other attributes form an object to another.

The standard form of a call to Assign method is
     Destination.Assign(Source);
which tells the Destination object to copy the contents of the Source object to itself.

Parameters
Source
Object to copy the content.
Protected procedure Clear;

Deletes all items from the collection.

Protected procedure Delete(Index: Integer);

Deletes a single item from the collection.

Parameters
Index
Position to delete
Protected procedure Move(CurIndex, NewIndex: Integer);

Moves an item to a new position into the collection.

Parameters
CurIndex
Index of Item to move
NewIndex
Destination index
Protected procedure PropertyChanged(Prop: TPersistent; PropName: string);

Method to call into the owner object when changes a property into the current object.

Parameters
Prop
Object property that has changed.
PropName
Name of the property that has changed.

Properties

Protected property Items[I:Integer]: TGMInterfacedCollectionItem read GetItems write SetItems;

List of items from collection.

Protected property OnChange: TNotifyEvent read FOnChange write FOnChange;

Event triggered when a property changes.


Generated by PasDoc 0.15.0.