TCustomListView.SortWithParams procedure
Sorts the Items in the list view control using the specified sort compare function.
Declaration
procedure SortWithParams(ACompareFunc: TListSortCompare)Arguments
ACompareFunc | Sort compare routine used to determine the sorted order for the values in Items. |
Description
SortWithParams is a method used to sort entries in the Items
property using the sort compare function in
ACompareFunc to
determine the order for the Items on the control. ACompareFunc normally
contains the routine needed for the setting in SortType, and may refer to the
OnCompare handler (when assigned).
No actions are performed in the method if Items has fewer than 2 TListItem instances in the property, or when lffPreparingSorting has already been included in the internal flags for the control.
SortWithParams ensures that state information for the class instance and its Items is stored / restored when the handle for the widget has been allocated. This includes the selected, focused, and checked list item(s) for the control.
SortWithParams calls the Sort method in Items using ACompareFunc as the sort compare routine.
If the widget Handle has been assigned, the widget is updated with the sort parameters such as SortType, SortColumns, and SortDirection. The saved state information is used to set values in the widget instance when the sort operation is completed. This includes settings like ItemFocused, Selected, and the Checked or Selected state for individual TListItem entries in Items. These actions are not performed (or needed) if the handle for the widget has not been assigned.
SortWithParams is called from the Sort and CustomSort methods.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
