Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

Accept method

Project: Drop Files Components.

Unit: PJDropFiles.

Class: TPJWildCardFileFilter

Applies to: ~>5.0

function Accept(
  const FilePath: string; const IsFolder: Boolean
): Boolean; override;

Description

Checks whether a given file or folder passes though the filter.

This method is called by the filter’s owning drop files component whenever files are dropped. It is called once for each dropped file or folder and returns true if the file or folder passes through the filter and false if not. FilePath is the fully qualified path of the file or folder concerned, while IsFolder indicates whether FilePath is a file or folder.

For a file to pass through the filter its file or folder name (not the path) must match the wild card specified in the WildCard property.

This method is used internally by the drop files components. There is no reason to call the method from program code unless to discover whether a file or folder will pass the filter.