ImageEn, unit iexFolderMView

TImageEnFolderMView.SortOptions

TImageEnFolderMView.SortOptions


Declaration

property SortOptions: TIEMSortOptions;


Description

Provides further options for the sorting of the file list.
Value Description
iesDescending Sorting is reversed, e.g. instead of A-Z, it sorts Z-A
iesCaseSensitive Casing of filenames/captions affects sorting, e.g. "TEXT" and "text" are treated as different with lowercase text having priority
iesNaturalSorting Considers digits in filenames when sorting, e.g. img1.jpg, img10.jpg, img11.jpg, img2.jpg will be sorted as img1.jpg, img2.jpg, img10.jpg, img11.jpg (Delphi XE2 or newer)

See also: SetSortOrderEx


Examples

// Toggle the sort direction
if iesDescending in IEFolderMView1.SortOptions then
  IEFolderMView1.SortOptions := IEFolderMView1.SortOptions - [iesDescending]
else
  IEFolderMView1.SortOptions := IEFolderMView1.SortOptions + [iesDescending];

// Sort by filename considering any digits within the name
// e.g. img1.jpg, img10.jpg, img11.jpg, img2.jpg, img20.jpg will be sorted as img1.jpg, img2.jpg, img10.jpg, img11.jpg, img20.jpg
IEFolderMView1.LockUpdate();
try
  IEFolderMView1.SortOrder := iesbFilename;
  IEFolderMView1.SortOptions := [iesNaturalSorting ];
finally
  IEFolderMView1.UnlockUpdate();
end;

// Which is the same as:
IEFolderMView1.SetSortOrderEx(iesbFilename, [iesNaturalSorting ]);