lazarus/docs/xml/lazutils/dynamicarray.xml

347 lines
9.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Documentation for LCL (Lazarus Component Library) and LazUtils (Lazarus
Utilities) are published under the Creative Commons Attribution-ShareAlike 4.0
International public license.
https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt
https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/docs/cc-by-sa-4-0.txt
Copyright (c) 1997-2025, by the Lazarus Development Team.
-->
<fpdoc-descriptions>
<package name="lazutils">
<!--
====================================================================
DynamicArray
====================================================================
-->
<module name="DynamicArray">
<short>Implements a resizable 2-D array of Pointers.</short>
<descr>
<p>
<file>dynamicarray.pas</file> implements a resizable 2-D array of Pointers. It
is used to implement the Cells, Cols, and Rows properties in
<var>TCustomGrid</var>, <var>TDrawGrid</var> and <var>TStringGrid</var>.
</p>
<p>
<file>dynamicarray.pas</file> is part of the <file>LazUtils</file> package.
</p>
<p>
Author: Jesus Reyes
</p>
</descr>
<!-- unresolved type reference Visibility: default -->
<element name="Classes"/>
<element name="SysUtils"/>
<element name="EArray">
<short>
Not used in the current LazUtils version.
</short>
<descr>
EArray is an Exception type. Not used in the current LazUtils implementation.
</descr>
<seealso/>
</element>
<element name="TOnNotifyItem">
<short>
Specifies and event handler signalled when an item is added to or removed
from TPointerPointerArray.
</short>
<descr>
<p>
<var>TOnNotifyItem</var> is the type used for the <var>OnDestroyItem</var>
and <var>OnNewItem</var> properties in <var>TPointerPointerArray</var>.
</p>
</descr>
<seealso>
<link id="TPointerPointerArray.OnDestroyItem"/>
<link id="TPointerPointerArray.OnNewItem"/>
</seealso>
</element>
<element name="TOnNotifyItem.Sender">
<short>Instance of the TArray that causes the event.</short>
</element>
<element name="TOnNotifyItem.Col">
<short>The Col number for the event.</short>
</element>
<element name="TOnNotifyItem.Row">
<short>The Row number for the event.</short>
</element>
<element name="TOnNotifyItem.Item">
<short>Pointer to the Item date for the event.</short>
</element>
<element name="TOnExchangeItem">
<short>
Not used in the current LazUtils version.
</short>
<descr/>
<seealso/>
</element>
<element name="TOnExchangeItem.Sender">
<short>The instance of the TArray that causes the Exchange event.</short>
</element>
<element name="TOnExchangeItem.Index">
<short>
Ordinal position for an array element exchanged in the handler.
</short>
</element>
<element name="TOnExchangeItem.WithIndex">
<short>
Ordinal position for an array element exchanged in the handler.
</short>
</element>
<element name="TPointerPointerArray">
<short>
Implements a resizable two-dimensional array using Pointers to column and row
values.
</short>
<descr/>
<seealso/>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<!-- private -->
<element name="TPointerPointerArray.FCols"/>
<element name="TPointerPointerArray.FOnDestroyItem"/>
<element name="TPointerPointerArray.FOnNewItem"/>
<element name="TPointerPointerArray.GetArr"/>
<element name="TPointerPointerArray.GetArr.Result"/>
<element name="TPointerPointerArray.GetArr.Col"/>
<element name="TPointerPointerArray.GetArr.Row"/>
<element name="TPointerPointerArray.SetArr"/>
<element name="TPointerPointerArray.SetArr.Col"/>
<element name="TPointerPointerArray.SetArr.Row"/>
<element name="TPointerPointerArray.SetArr.AValue"/>
<element name="TPointerPointerArray.ClearCol"/>
<element name="TPointerPointerArray.ClearCol.L"/>
<element name="TPointerPointerArray.ClearCol.Col"/>
<element name="TPointerPointerArray.Aumentar_Rows"/>
<element name="TPointerPointerArray.Aumentar_Rows.Col"/>
<element name="TPointerPointerArray.Aumentar_Rows.Rows"/>
<element name="TPointerPointerArray.Aumentar_Rows.L"/>
<element name="TPointerPointerArray.DestroyItem"/>
<element name="TPointerPointerArray.DestroyItem.Col"/>
<element name="TPointerPointerArray.DestroyItem.Row"/>
<element name="TPointerPointerArray.DestroyItem.P"/>
<!-- public -->
<element name="TPointerPointerArray.Create">
<short>
Constructor for the class instance.
</short>
<descr>
<p>
<var>Create</var> allocates resources for the internal TFPList used to store
the values in the indexed Arr property.
</p>
</descr>
<seealso>
<link id="TPointerPointerArray.Arr"/>
<link id="#rtl.classes.TFPList">TFPList</link>
</seealso>
</element>
<element name="TPointerPointerArray.Destroy">
<short>
Destructor for the class instance.
</short>
<descr>
<p>
<var>Destroy</var> 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.
</p>
</descr>
<seealso>
<link id="TPointerPointerArray.Arr"/>
<link id="TPointerPointerArray.Clear"/>
<link id="#rtl.classes.TFPList">TFPList</link>
</seealso>
</element>
<element name="TPointerPointerArray.SetLength">
<short>
Sets the dimensions for the array to the specified number of columns and rows.
</short>
<descr>
<p>
<var>SetLength</var> 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.
</p>
<p>
Cols contains the new number of columns for the array.
</p>
<p>
Rows contains the new number of rows for the array.
</p>
</descr>
<seealso>
<link id="TPointerPointerArray.OnDestroyItem"/>
<link id="TPointerPointerArray.Arr"/>
<link id="#rtl.classes.TFPList">TFPList</link>
</seealso>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<element name="TPointerPointerArray.SetLength.Cols">
<short>
Number of columns for the two-dimensional array.
</short>
</element>
<element name="TPointerPointerArray.SetLength.Rows">
<short>
Number of rows for the two-dimensional array.
</short>
</element>
<element name="TPointerPointerArray.DeleteColRow">
<short>
Deletes a column or row at the specified ordinal position in the array.
</short>
<descr>
<p>
<var>DeleteColRow</var> 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.
</p>
</descr>
<seealso/>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<element name="TPointerPointerArray.DeleteColRow.IsColumn">
<short>
<b>True</b> if a column is removed. <b>False</b> if a row is removed.
</short>
</element>
<element name="TPointerPointerArray.DeleteColRow.Index">
<short>
Ordinal position for the column or row deleted in the method.
</short>
</element>
<element name="TPointerPointerArray.MoveColRow">
<short>
Moves a column or row at the specified ordinal position to a new location in
the array.
</short>
<descr/>
<seealso>
<link id="#rtl.classes.TFPList.Move">TFPList.Move</link>
</seealso>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<element name="TPointerPointerArray.MoveColRow.IsColumn">
<short>
<b>True</b> if a column is moved in the method. <b>False</b> if a row is
moved.
</short>
</element>
<element name="TPointerPointerArray.MoveColRow.FromIndex">
<short>
Ordinal position for the column or row moved in the method.
</short>
</element>
<element name="TPointerPointerArray.MoveColRow.ToIndex">
<short>
New ordinal position where the column or row is stored.
</short>
</element>
<element name="TPointerPointerArray.ExchangeColRow">
<short>
Exchanges values for array elements in the specified columns or rows in the
array.
</short>
<descr/>
<seealso>
<link id="#rtl.classes.TFPList.Move">TFPList.Move</link>
</seealso>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<element name="TPointerPointerArray.ExchangeColRow.IsColumn">
<short>
<b>True</b> if a values in columns are exchanged in the method. <b>False</b>
if values in rows are exchanged.
</short>
</element>
<element name="TPointerPointerArray.ExchangeColRow.Index">
<short>
Ordinal position for a column or row affected in the method.
</short>
</element>
<element name="TPointerPointerArray.ExchangeColRow.WithIndex">
<short>
Ordinal position for a column or row affected in the method.
</short>
</element>
<element name="TPointerPointerArray.Clear">
<short>
Removes pointers and frees resources for all columns and rows in the
two-dimensional array.
</short>
<descr/>
<seealso>
<link id="TPointerPointerArray.OnDestroyItem"/>
</seealso>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<element name="TPointerPointerArray.Arr">
<short>
Provides indexed access Pointer values in the elements for the array.
</short>
<descr>
<p>
<var>Arr</var> 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.
</p>
</descr>
<seealso>
<link id="#rtl.classes.TFPList">TFPList</link>
</seealso>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<element name="TPointerPointerArray.OnDestroyItem">
<short>
Performs actions needed when the Pointer in an array element is removed from
the array.
</short>
<descr/>
<seealso>
<link id="TPointerPointerArray.SetLength"/>
<link id="TPointerPointerArray.DeleteColRow"/>
<link id="TPointerPointerArray.Clear"/>
<link id="TOnNotifyItem"/>
</seealso>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
<element name="TPointerPointerArray.OnNewItem">
<short>
Performs actions needed when a new Pointer is needed for an array element
added to a column or row in the array.
</short>
<descr/>
<seealso>
<link id="TPointerPointerArray.SetLength"/>
</seealso>
<example file="examples/dynamicarray/tarrayexample.pas"/>
</element>
</module>
<!-- DynamicArray -->
</package>
</fpdoc-descriptions>