Sign in Join
FPDoc Onlineexperiment

TLVCompare procedure type

In unit ComCtrls

Specifies a routine used to compare the values in two items in a list view control.

Declaration

pascal
TLVCompare = function(Item1: TListItem; Item2: TListItem; 
 AOptionalParam: PtrInt): Integer

Arguments

Item1

First list item for the comparison.

Item2

Second list item for the comparison.

AOptionalParam

Pointer to an optional Integer value used in the comparison.

Function result

Relative sort order for the specified list items.

Description

TLVCompare is a routine used to determine the relative sort order for the list items passed in the Item1 and Item2, and allows an optional Integer parameter value used in the comparison. The return value is the relative sort order for the TListItem instances. For example:

-1
Item1 comes before Item2 in the sort order.
0
Item1 and Item2 have the same sort order value.
1
Item1 comes after Item2 in the sort order.

A TLVCompare type is passed as an argument to the CustomSort method in TCustomListView.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.