Implements a resizable 2-D array of Pointers.

dynamicarray.pasimplements a resizable 2-D array of Pointers. It is used to implement the Cells, Cols, and Rows properties in TCustomGrid, TDrawGrid and TStringGrid.

This file is part of the LazUtils package.

Author: Jesus Reyes

EArray is an Exception type. Not used in the current LCL implementation. Type for event handling. instance of the TArray that causes the event. The related Col of the event. The related Row of the event. The related Item of the event. The instance of the TArray that causes the Exchange event. Implements a resizable two-dimensional array using Pointers to column and row values. Constructor for the class instance.

Create allocates resources for the internal TFPList used to store the values in the indexed Arr property.

TFPList
Destructor for the class instance.

Destroy calls the Clear method to ensure that nested TFPList instances and Pointers in the Arr property are freed. The TFPList resource allocated for the Arr property is also freed.

TFPList
Sets the dimensions for the array to the specified number of columns and rows.

SetLength ensures that columns and/or rows are adjusted when the the new size values are smaller than the existing dimensions for the array. The OnDestroyItem event handler is signalled (when assigned) to perform actions needed for Pointers removed from the array elements.

Cols contains the new number of columns for the array.

Rows contains the new number of rows for the array.

TFPList
Number of columns for the two-dimensional array. Number of rows for the two-dimensional array. Deletes a column or row at the specified ordinal position in the array.

DeleteColRow is a method used to delete the specified column or row from the two-dimensional array. DeleteColRow signals the OnDestroyItem event handler (when assigned) to perform actions needed for the Pointers in the array elements.

True if a column is removed. False if a row is removed. Ordinal position for the column or row deleted in the method. Moves a column or row at the specified ordinal position to a new location in the array. TFPList.Move True if a column is moved in the method. False if a row is moved. Ordinal position for the column or row moved in the method. New ordinal position where the column or row is stored. Exchanges values for array elements in the specified columns or rows in the array. TFPList.Move True if a values in columns are exchanged in the method. False if values in rows are exchanged. Ordinal position for a column or row affected in the method. Ordinal position for a column or row affected in the method. Removes pointers and frees resources for all columns and rows in the two-dimensional array. Provides indexed access Pointer values in the elements for the array.

Arr is an indexed Pointer property which provides access to array elements by their ordinal column and row positions. Array is the default property for the class instance.

TFPList
Performs actions needed when the Pointer in an array element is removed from the array. Performs actions needed when a new Pointer is needed for an array element added to a column or row in the array.