Provides a TCollection that can be sorted.
Component users would descend from this class and either assign a
OnCompare event handler or override the
Compare and
IsSortable functions. TCollectionItem descendants would call the
SortItem method when the property the collection sorts on is changed
Namespace: Structures
|
Name
|
Description
|
|
DoNotNotify
|
Suppresses the Notify method from notifying an owner about an insertion in the collection. SortItem uses this property to move the item to its correct sort order place in the collection without triggering a notification about the change.
|
|
Sorted
|
Controls whether the collection is sorted or not
|
|
SortOrder
|
Specifies the sort order to use.
|
Top
|
|
Name
|
Description
|
|
AssignTo(TPersistent)
|
Represents method AssignTo(TPersistent). (Inherited from Structures.TGCollection.)
|
|
Compare(TCollectionItem,TCollectionItem)
|
Compares the two collection items and returns -1, 0, or 1. The Sort method uses the Compare method to determine the sort order of the items.
Warning
|
The OnCompare event handler must be defined
|
|
|
CustomSort(TCollectionItemCompareEvent)
|
Sorts the collection using a custom sorting function. Use this function to sort the collection using a different function than the OnCompare event.
|
|
IndexOf(String)
|
Returns the index of the collection item where CollectionItem.DisplayName equals the DisplayName search parameter. The comparison is case sensitive.
If no collection item equals the parameter, the function returns a -1.
|
|
IsSortable
|
Returns true if this collection can be sorted, i.e., does it have an OnCompare event.
|
|
Notify(TCollectionItem,Classes)
|
Represents method Notify(TCollectionItem,Classes).
|
|
QuickSort(Integer,Integer,TCollectionItemCompareEvent)
|
Sorts the collection using the Quicksort algorithm. The QuickSort method calls the Compare method to determine the sort order of the items.
|
|
Sort
|
Sorts the collection
|
|
SortItem(TCollectionItem)
|
Inserts the item into the collection at its place in the sort order.
|
Top
|
|
Name
|
Description
|
|
OnCompare
|
Determines the sort order between 2 collection items. Returns either -1, 0, or 1.
|
Top
|