ImageEn, unit iexFolderMView

TImageEnFolderMView.Folder

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_Connected_Devices Shows all connected devices (tablets, cell phones, etc.)


Notes:
- 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


Examples


// 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;


// 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\';