Class TFileListView (unit FileList)

Inherits from

TListView

Description: This unit produces a list of files, which can be sorted in various ways by clicking on the top of the column, like Explorer. It extends the TListView component adding an AddFile method to add a file to the end of the list. The details for the file are extracted from the directory using FindFirst and the ShellFileOperations. Files that don't exist will not be added to the list. Notes: This unit requires the ShortDateFormat and LongTimeFormat to be defined so for the time being, these have been defined in the unit as: ShortDateFormat := 'yyyy/mm/dd'; LongTimeFormat := 'hh:nn'; Revision history: V1.0.0 1997 Apr 27 First version V1.1.0 1997 May 12 Version for Delphi 3.0 Add compile-time live data, but don't save it V1.1.2 1997 May 18 Make RowSelect true by default V1.1.4 1998 Feb 23 Add file version information column V1.1.6 1998 Mar 15 Correct sort error when columns don't contain valid data Force attributes column to have spaces where attr are unset Add product version info column V1.1.8 1998 Mar 16 Add even more defensive programming for text compare errors Alter columns to make width depend on header, not body text

Constructors


constructor Create(AOwner: TComponent);

Public declarations


Functions

function AddFile (filename: string; var filesize: integer): boolean;

sort on file modified date

procedure CreateWnd;

default is sort on size column

procedure FColumnClick(Sender: TObject; Column: TListColumn);

as a demo, find all the VCL files in the Windows System folder

procedure FCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer);

and the sort order

the TListView to actually sort


Properties

property AllocBy :

Published declarations

property HideSelection :


property Items :


property MultiSelect :


property ReadOnly :


property RowSelect :


property ShowColumnHeaders :


property ViewStyle :


Events

Variables

FSortColumn : integer;

Private declarations

FSortForward : boolean;

which column we sort on


Constructors


constructor Create(AOwner: TComponent);

Public declarations


Functions


function AddFile (filename: string; var filesize: integer): boolean;

sort on file modified date


procedure CreateWnd;

default is sort on size column


procedure FColumnClick(Sender: TObject; Column: TListColumn);

as a demo, find all the VCL files in the Windows System folder


procedure FCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer);

and the sort order

the TListView to actually sort


Properties


property AllocBy :

Published declarations


property HideSelection :


property Items :


property MultiSelect :


property ReadOnly :


property RowSelect :


property ShowColumnHeaders :


property ViewStyle :


Events


Variables


FSortColumn : integer;

Private declarations


FSortForward : boolean;

which column we sort on