From 499f015011006f53b72be8826a520840170687ac Mon Sep 17 00:00:00 2001 From: dsiders Date: Wed, 15 Mar 2023 21:19:09 +0100 Subject: [PATCH] Docs: LCL/shellctrls. Adds and updates topics for changes in 6a85abf6. * Adds: * TShellListItem * TShellListItem.FFileInfo * TShellListItem.IsFolder * TShellListItem.FileInfo * TCustomShellListView.CreateListItem * Updates: * TCustomShellListView.PopulateWithRoot --- docs/xml/lcl/shellctrls.xml | 143 ++++++++++++++++++++++++++++++++++-- 1 file changed, 136 insertions(+), 7 deletions(-) diff --git a/docs/xml/lcl/shellctrls.xml b/docs/xml/lcl/shellctrls.xml index e521885246..a7276a8cca 100644 --- a/docs/xml/lcl/shellctrls.xml +++ b/docs/xml/lcl/shellctrls.xml @@ -1817,6 +1817,103 @@ the notification. Or, use the ListView property in the List item for the event notification. + + +Implements the class used for list items maintained in TShelllListView. + + +

+TShellListItem is a TListItem descendant which +implements the class used for the list items in the TShellListView control. It +extends the ancestor class with the FileInfo property used for file system +information about the list item. It also includes the IsFolder method to +identify whether the list item is a directory on the local file system. +

+

+TShellListItem is the default class type used to create a new list item in the +TCustomShellListView.CreateListItem method. It can, however be overridden by +using an OnCreateItemClass event handler in the shell list view control. It is +also used in the PopulateWithRoot method in TCustomShellListView to cast a new +TFileItem instance created when the a file is added to the Items for the +control. +

+
+ + + + + +TListItem +TListItems.Add +TFileItem.Create + +
+ + + + + + + +Checks for the directory attribute in the file system information for the list +item. + + +

+The return value is True if the Attr member in FileInfo includes the +faDirectory flag value. +

+
+ + + +FindFirst +FindNext +TRawbyteSearchRec +TUnicodeSearchRec + +
+ + +Returns True if the list item represents a directory on the local file +system. + + + + + +File system information about the list item. + + +

+FileInfo is a TSearchRec property which contains file +system information about the list item. It is a record instance returned from +the FindFirst or FindNext routines in the RTL, and contains the attributes for +a file or folder on the local file system. FileInfo includes values like: +

+
    +
  • Timestamp
  • +
  • Size
  • +
  • Attributes
  • +
  • Excluded Attributes
  • +
  • Find Handle
  • +
  • File Mode (on UNIX-like platforms)
  • +
  • Find Data Structure (or symlink structure on UNIX-like platforms)
  • +
+
+ + + + + + +FindFirst +FindNext +TRawbyteSearchRec +TUnicodeSearchRec + +
+ The base class that defines a list view control to display the files, @@ -2037,6 +2134,31 @@ is called for the class instance or its Parent. + + +Create a new entry added to the Items for the shell control. + + +

+CreateListItem is an overridden TListItem function in +TCustomShellListView. It ensures that the TShellListItem class type is used +for new Items added to the shell control. If an OnCreateItemClass event +handler has been assigned, the inherited method in TCustomListView is called +to confirm/override the item class used and to create the new instance added +to Items. +

+

+The return value contains the new TListItem (or descendent) class instance +created for the list item in the method. +

+
+ +TCustomListView.CreatelistItem +TListItem +TListItems.Add + +
+ Fills the list view with file system information for the directory in Root. @@ -2061,10 +2183,16 @@ 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 property.

-A TListItem instance is added to Items to represent each of 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 in the list item to store the -string representation for the file size, and the file extension. +The add method in Items is called to create the list items which represent +each of the files or directories. If a list item is a TShellListItem class +type, its FileInfo property is updated with the file information from the +TFileItem created in GetFilesInDir. +

+

+The Caption is used to store the file or directory name in the list item. The +Data property in the list item is used to store a pointer to the file size. +Values are added to SubItems in the list item to store the string +representation for the file size, and the file extension.

When UseBuiltInIcons is set to True, the GetBuiltInImageIndex method @@ -2096,6 +2224,7 @@ using the option specified in the FileSortType property. + @@ -2960,9 +3089,9 @@ For TMaskCaseSensitivity, a string version of the enumeration value is used as the return value. For example:

- 'mcsPlatformDefault' - 'mcsCaseInsensitive' - 'mcsCaseSensitive' + 'mcsPlatformDefault' + 'mcsCaseInsensitive' + 'mcsCaseSensitive'