ImageEn, unit iexFolderMView

TImageEnFolderMView.AppendFile

TImageEnFolderMView.AppendFile


Declaration

function AppendFile(const sFilename : string; bSelectIt : Boolean = True; bCheckFileType : Boolean = True) : integer;


Description

Adds a new file at last position in the grid and returns the new image position. If bSelectIt is enabled the new file will be selected.
If bCheckFileType is enabled then the file is only added if it is permitted by folder parameters: FileTypes, FileTypesMask, ExclusionMask, ShowFolders and ShowHiddenFiles

Result is -1 if the file does not exist.

Notes:
- Unlike the AppendImage methods, the added file will be loaded on demand and filled with the details and properties of TImageEnFolderMView
- After adding many files you may want to call RefreshSorting
- You can use RefreshFileList to update the content if files change on the system (i.e. missing files will be removed from the control)


Example

// Filling the control manually
IEFolderMView1.LockUpdate();
IEFolderMView1.Folder := '';
IEFolderMView1.AppendFile( 'C:\image.jpg' );
IEFolderMView1.AppendFile( 'D:\WordDoc.docx' );
IEFolderMView1.AppendFile( 'D:\Documents\' ); // Only the icon for the folder, not all the files it contains
IEFolderMView1.FillFromDirectory( 'C:\MyImages\' ); // Add all the files it contains
IEFolderMView1.RefreshSorting();
IEFolderMView1.UnlockUpdate();


See Also

- InsertImage
- InsertFile
- FillFromDirectory
- RefreshSorting