Sign in Join
FPDoc Onlineexperiment

TCustomFileListBox.UpdateFileList procedure

Member of TCustomFileListBoxpublicIn unit FileCtrl

Loads the list of files and/or directories for the list box control.

Declaration

pascal
procedure UpdateFileList; virtual

Description

UpdateFileList is a method used to load the list of file and/or directory names in the Items for the control. No actions are performed in the method at design-time, or when the component is being loaded using the LCL streaming mechanism.

UpdateFileList calls Clear to remove any existing values in the Items property.

Values in FileType are used to construct file attributes needed for use with TSearchRec. The FindFirstUTF8 and FindNextUTF8 routines from LazFileUtils are used to find matching file or directory names in the Directory for the control. Each value returned for the TSearchRec is compared to the Mask and FileType defined in the control. Acceptable values are added to the Items property.

Please note that Directory names (included when FileType contains ftDirectory) are surrounded by square brackets ('[]') when added to the Items property.

The private UpdateSelectedFileName method is called to include path information in FileName for the selected item in the control.

UpdateFileList is called in the implementation of the Create and Loaded methods. It is also called when a new value is assigned to Drive, Directory, FileType, or Mask.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.