[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'ShellCtrls' (#lcl)

TCustomShellListView.PopulateWithRoot

Fills the list view with file system information for the root directory.

Declaration

Source position: shellctrls.pas line 231

protected procedure TCustomShellListView.PopulateWithRoot;

Description

PopulateWithRoot is a procedure used to fill the Items in the list view with file system entries for the Root directory.

No actions are performed in the method at design-time, or when Root contains an empty string ('').

PopulateWithRoot calls the internal GetFilesInDir helper to get a list of file system items for the path which match the Mask and ObjectTypes specified for the control. Each of the files in the list are passed to DoAddItem / OnAddItem to determine if they can be added to the Items in the control.

A TListItem instance is added to Items to represent the files or directories. The Data property in the list item is used to store a pointer to the file size. Values are added to SubItems with the string representation for the file size, and the file extension.

When UseBuiltInIcons is set to True, the GetBuiltInImageIndex method is called to get the ImageIndex for the built-in icon for a list item. This action is performed using the path to the current file name when LargeImages and/or SmallImages have not been assigned. The value in ViewStyle determines the image size requested. When ViewStyle is vsIcon, LargeImages is checked (when assigned). Otherwise, SmalImages is checked (when assigned). If an imagelist exists in either LargeImages or SmallImages, the existing ImageIndex in the list item is used.

The OnFileAdded event handler is signalled (when assigned) for each new entry added to Items.

The Sort method is called prior to exit to order the Items in the control using the option specified in the FileSortType property.

See also

TCustomShellListView.Root

  

Indicates the initial directory path whose objects are displayed in the control.

TCustomShellListView.Items

  

Collection of list items displayed on the list view control.

TCustomShellListView.Mask

  

File mask used to select items displayed in the shell control.

TCustomShellListView.ObjectTypes

  

Indicates which objects are visible in the control (files and/or directories, hidden files, etc.).

TCustomShellListView.UseBuiltInIcons

  

Indicates if icons provided by the OS or platform are used for items in the list.

TCustomShellTreeView.FileSortType

  

Indicates how the items should be sorted in the tree.

TCustomShellListView.DoAddItem

  

Signals the OnAddItem event handler when an entry is added to the Items in the control.

TCustomShellListView.OnAddItem

  

Event handler signalled to determine if the specified file information can be added to the Items for the list view.

TCustomShellListView.OnFileAdded

  

Event handler signalled when a file is added to the Items in the control.

TAddItemEvent

  

Specifies an event handler signalled when an item is added to a shell control.

TCSLVFileAddedEvent

  

Specifies an event handler signalled when an item is added to TCustomShellListView.