ImageEn, unit iexFolderMView |
|
TImageEnFolderMView.Folder
Declaration
property Folder: string;
Description
Specifies the folder to search for files with which we fill the control. You can specify multiple folders by delimiting them with IEM_Folder_Delimiter (which is a bar: |). Files in sub-folders will be included if
IncludeSubFolders is enabled.
The type of files to be retrieved is specified by
FileTypes and
FileTypesMask. You can exclude particular types with
ExclusionMask.
To update all folder properties at once, use
SetFolderEx.
The following constants can be specified in place of a folder path:
Constant | Description |
IEF_Desktop_Folder | Windows Desktop |
IEF_Drives_Folder | "This PC" is shown (listing all drives on the system) |
IEF_Root_Directory | The drive containing Windows (usually C:\) |
IEF_MyDocuments_Folder | The user's "Documents" folder |
IEF_MyPictures_Folder | The user's "Pictures" folder |
IEF_MyVideos_Folder | The user's "Videos" folder |
IEF_AppExe_Folder | The folder of the application |
IEF_Connected_Devices | Shows all connected devices (tablets, cell phones, etc.) |
Setting folder to IEF_Drives_Folder:
Note:
◼The value of
Folder at start-up is defined by
DefaultFolder. If
DefaultFolder is not iedfSpecified then any value you have set for
Folder at design time is ignored.
◼IEF_Drives_Folder will also display connected devices if
ShowDevices is enabled
// Retrieve only JPEG images
IEFolderMView1.LockUpdate();
try
IEFolderMView1.Folder := 'C:\Images\';
IEFolderMView1.FileTypes := iefCustom;
IEFolderMView1.FileTypesMask := 'jpg,jpeg,jpe';
finally
// Re-enable updating and refresh content
IEFolderMView1.UnlockUpdate();
end;
// This is the same as calling:
IEFolderMView1.SetFolderEx('C:\Images\', iefCustom, 'jpg,jpeg,jpe');
// Display "My Pictures" folder
IEFolderMView1.Folder := IEF_MyPictures_Folder;
// Which is the same as...
IEFolderMView1.Folder := WindowsMyPicturesFolder();
// Display C:\Pix\ and D:\Pix\
IEFolderMView1.Folder := 'C:\Pix\|D:\Pix\';
// Display content of all drives on system by delimiting them with IEM_Folder_Delimiter
procedure TForm1.btnShowAllDrives(Sender: TObject);
var
vDrivesSize : Cardinal;
vDrives : array[0..128] of Char;
vDrive : PChar;
sDrives: string;
begin
sDrives := '';
vDrivesSize := GetLogicalDriveStrings(SizeOf(vDrives), vDrives);
if vDrivesSize > 0 then
begin
vDrive := vDrives;
while vDrive^ <> #0 do
begin
sDrives := sDrives + StrPas(vDrive) + IEM_Folder_Delimiter;
Inc(vDrive, SizeOf(vDrive));
end;
end;
IEFolderMView.Folder := sDrives;
end;
// Show Devices only
IEFolderMView1.LockUpdate();
IEFolderMView1.ShowDevices := True;
IEFolderMView1.EnableSpecialFolders := False; // top folder is Devices
IEFolderMView1.Folder := IEF_Connected_Devices;
IEFolderMView1.UnlockUpdate();
// Show drives and connected devices
IEFolderMView1.ShowDevices := True;
IEFolderMView1.Folder := IEF_Drives_Folder;
// Display a folder from a connected device
IEFolderMView1.Folder := 'This PC\My Tablet\Internal Storage\DCIM\Camera\';