ImageEn, unit iexFolderMView

TImageEnFolderMView


Declaration

TImageEnFolderMView = class(TImageEnMView);


Description

The TImageEnFolderMView component is a descendent of TImageEnMView, but is designed specifically for displaying the content of file folders.




While much of TImageEnFolderMView's functionality can be replicated in TImageEnMView using FillFromDirectory, there are a number of features that are only available in this control:
- Dragging and dropping files from Windows
- Cut, copy and paste files from Windows Explorer
- Automatic refreshing when folder contents change
- Display of the standard folder popup menu
- File functions to move, copy, rename and delete files
- In-built file navigation, keyboard shortcuts and other functions

To use TImageEnFolderMView, specify a Folder and the file types that you wish to display. For more control you can specify your own file mask, exclusion mask and sort order.

For rapid UI development TImageEnFolderMView provides a set of actions, plus you can use all actions of TImageEnMView.

Navigating to the "Drives" folder:



TImageEnFolderMView supports VCL Theming:




Overview




Display Styles

There are four standard styles. Ensure you set AutoAdjustStyle := True; so that setting the style automatically updates all relevant properties.
iemsFlat iemsFlatAndWide
iemsFilenames iemsColumns


Thumbnail Performance

Because a TImageEnMView may potentially load and store thousands of files, you should optimize your settings to ensure the best performance. Take note of the following:
Most importantly, decide whether to load and store full size images, or just preview thumbnails. If you are loading the content of a multi-page file, such as TIFF, for editing and display, then generally you will want StoreType=ietNormal. However, if you are displaying thousands of photos from a folder, for example, then you are better to use load only thumbnails (StoreType is ietThumb or ietFastThumb)
Load images only on demand (i.e. as they are displayed or needed). To do this, ensure the LoadOnDemand parameter is set for AppendImage, InsertImage, FillFromDirectory or FillFromList. Or if you are just loading a single file with many pages, use LoadFromFileOnDemand
Lock updating while performing batch operations (LockUpdate/UnlockUpdate)
Consider options to load EXIF thumbnails or Windows Explorer thumbnails
Choose a good balance between quality and speed when setting the ThumbnailResampleFilter
Increasing the size of the image cache can help with general performance, especially when StoreType=ietFastThumb


Recommended Defaults

For compatibility, some of the default options of TImageEnFolderMView are not the recommended ones. Here are some suggested changes:

Enable AutoAdjustStyle so you that setting Style will automatically update relevant layout properties:
  ImageEnMView1.AutoAdjustStyle := True;

Enable ShowThumbnailHint to show file details when hovering over a thumbnail:
  ImageEnMView1.ShowThumbnailHint := true;

Enable selection of multiple files:
  ImageEnMView1.EnableMultiSelect := true;


Demos

Demo  Demos\Multi\Explorer\ExplorerDemo.dpr
Demo  Demos\Multi\FolderMView\FolderMView.dpr
Demo  Demos\Actions\Actions_Folder\FolderMViewActions.dpr


Keyboard Shortcuts

The following keyboard shortcuts are supported:

Shortcut Description Option to Enable
Cursor Keys Navigate mkiMoveSelected
Ctrl/Shift+Cursor Keys Select multiple files mkiMoveSelected
Numbers and letters Select next filename starting with a letter mkiLetterNavigation
Ctrl+A Select all files mkiMoveSelected
Delete Delete the selected file ieboEnableFileShortcuts
F2 Rename the selected file ReadOnly
Backspace Open parent folder ieboEnableFolderShortcuts
F5 Refresh file list ieboEnableFolderShortcuts
Enter Open folder/launch file (if launch option enabled in FolderInteract) ieboEnableFolderShortcuts
Alt+Enter Display the File Properties Dialog ieboEnableFileShortcuts
Ctrl+C/X/V Cut/Copy/Paste files ieboEnableFileShortcuts
Shift+F10 Display the system popup menu (if PopupMenuUseSystem is enabled) ieboEnableFileShortcuts


Example

procedure TForm1.FormCreate(Sender: TObject);
begin
  // Setup TImageEnFolderMView
  IEFolderMView1.AutoAdjustStyle := True; // Enable so that setting "Style" will automatically update all relevant properties
  IEFolderMView1.GridWidth := -1; // Automatically adjust the column count to match the control width
  IEFolderMView1.ThumbWidth := 150; // Increase size of thumbnails
  IEFolderMView1.ThumbHeight := 140; // Increase size of thumbnails
  IEFolderMView1.ShowThumbnailHint := true; // Show file details when hovering over a thumbnail
  IEFolderMView1.EnableMultiSelect := true; // Enable selection of multiple files
end;


// Now display the images of a folder in the grid
IEFolderMView1.Folder := 'C:\MyImages\';
IEFolderMView1.FileTypes := iefAllImages; // Images only
IEFolderMView1.SortOrder := iesbImageSize; // Sort by image dimensions


// Alternatively you can fill the control manually
// Note: Some functionality will be unavailable such as pasting and dragging files to the folder
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(); // Sort all files
IEFolderMView1.UnlockUpdate();


Methods and Properties

Embedded Components
Public Property  Proc (Image editing and analysis methods)
Public Property  MIO (Acquisition and printing)

Folder Display
Public Property  AutoRefresh
Published Property  DefaultFolder
Published Property  EnableSpecialFolders
Published Property  ExclusionMask
Public Property  FileLimit
Published Property  FilenameFilter
Published Property  FileTypes
Published Property  FileTypesMask
Published Property  Folder
Published Property  IncludeSubFolders
Published Property  PopupMenuUseSystem
Public Method  PromptForFolder
Public Method  RefreshFileList
Public Method  RefreshSorting
Public Method  SetFolderEx
Public Method  SetSortOrderEx
Published Property  SortAscending
Published Property  SortCaseSensitive
Published Property  SortOrder
Published Property  ShowDevices
Published Property  ShowFolders
Published Property  ShowHiddenFiles

File Operations
Published Property  AutoDragFiles
Published Property  AutoDropFiles
Public Method  CreateNewFolder
Public Method  ExecuteFile
Public Method  ExecuteFolder
Public Method  CopyFilesToCurrentFolder
Public Method  CopySelectedFilesToClipboard
Public Method  CopySelectedFilesToFolder
Public Method  CutSelectedFilesToClipboard
Public Method  DeleteSelectedFilesFromFolder
Published Property  FileOperationOptions
Published Property  FolderInteract
Public Method  MoveFilesToCurrentFolder
Public Method  MoveSelectedFilesToFolder
Public Method  OpenFolder
Public Method  OpenParentFolder
Public Method  CanOpenParentFolder
Public Method  PasteFilesFromClipboard
Public Method  CanPasteFilesFromClipboard
Public Method  PopupSystemMenu
Public Method  ReadOnly
Public Method  RenameFile

Display
Public Property  Animation
Public Property  AnnotationsVisible
Published Property  AutoAdjustStyle
Published Property  Background
Published Property  BackgroundColor2
Published Property  BackgroundStyle
Published Property  BiDiMode
Public Method  CenterFrame
Public Method  DisplayImageAt
Public Property  GradientEndColor
Published Property  GridWidth (Column count)
Public Method  LockPaint
Public Property  LockPaintCount
Public Method  LockUpdate
Public Property  LockUpdateCount
Public Property  MaximumViewX
Public Property  MaximumViewY
Public Method  SetChessboardStyle
Public Method  SetModernStyling
Public Method  SetStyleEx
Public Method  SetViewXY
Published Property  Style
Public Method  UnlockPaint
Public Method  UnfilteredCount
Public Method  UnlockUpdate
Public Property  ViewX
Public Property  ViewY
Published Property  Wallpaper
Published Property  WallpaperStyle

Editing
Public Method  AppendFile
Public Method  AppendImage
Public Method  AppendSplit
Public Method  Clear
Public Method  CreateMorphingSequence
Public Method  DeleteImage
Public Property  ImageCount
Public Method  InsertFile
Public Method  InsertImageEx
Public Method  InsertImage
Public Method  MoveImage
Public Method  RemoveBlankPages
Public Method  RemoveFile

Image Access
Public Property  Bitmap
Public Method  CopyToIEBitmap
Public Method  GetBitmap
Public Method  GetTIEBitmap
Public Property  IEBitmap
Public Method  PrepareSpaceFor
Public Method  ReleaseBitmap
Public Method  SetImage
Public Method  SetImageEx
Public Method  SetImageRect
Public Method  UpdateImage

Image Information
Public Method  FilenameToIndex
Public Property  ImageBackground
Public Property  ImageBitCount
Public Property  ImageDelayTime
Public Property  ImageCol
Public Property  ImageCreateDate
Public Property  ImageEditDate
Public Property  ImageFileName
Public Property  ImageFileSize
Public Property  ImageFileType
Public Property  ImageFiltered
Public Property  ImageHeight
Public Property  ImageID
Public Property  ImageOriginalHeight
Public Property  ImageOriginalWidth
Public Property  ImageRow
Public Property  ImageTag
Public Property  ImageUserPointer
Public Property  ImageWidth
Public Property  ImageX
Public Property  ImageY

Image Text
Published Property  BottomTextFont
Published Property  DefaultBottomText
Published Property  DefaultInfoText
Published Property  DefaultTopText
Public Property  ImageBottomText
Public Property  ImageInfoText
Public Property  ImageTopText
Published Property  InfoTextFont
Published Property  ParentFont
Public Property  SelectedFontColor
Public Method  SetAllText
Public Property  ShowText
Public Property  TextBackgroundColor
Public Property  TextBackgroundStyle
Published Property  TextMargin
Published Property  TextTruncSide
Published Property  TopTextFont

Thumbnail Appearance
Published Property  EnableAlphaChannel
Public Property  FillThumbnail (Highlight Selection)
Public Property  IconSize
Public Method  SetThumbnailSize
Published Property  ShowThumbnailHint
Public Property  SoftShadow
Published Property  ThumbHeight
Public Property  ThumbnailClipping
Public Property  ThumbnailDisplayFilter
Public Property  ThumbnailFrameRect
Public Property  ThumbnailFrameSelected
Public Property  ThumbnailFrame
Public Property  ThumbnailResampleFilter
Published Property  ThumbnailsBackground
Published Property  ThumbnailsBackgroundHover
Published Property  ThumbnailsBackgroundSelected
Published Property  ThumbnailsBackgroundStyle
Published Property  ThumbnailsBorderColor
Published Property  ThumbnailsBorderWidth
Published Property  ThumbnailsInternalBorderColor
Published Property  ThumbnailsInternalBorder
Published Property  ThumbnailOptionsEx
Public Property  ThumbsRounded
Public Method  ThumbSizeInfo
Published Property  ThumbWidth
Published Property  Zoom

Thumbnail Spacing
Published Property  BottomGap
Published Property  HorizBorder
Published Property  LeftGap
Published Property  RightGap
Published Property  UpperGap
Published Property  VertBorder

Input/Output
Public Method  ClearImageCache
Published Property  DiskCache
Public Property  EnableAdjustOrientation (Auto-Rotate)
Public Property  EnableImageCaching
Public Property  EnableLoadEXIFThumbnails
Public Property  EnableLoadExplorerThumbnails
Public Method  EnsureImageLoaded
Public Method  GetImageToFile
Public Method  GetImageToStream
Published Property  ImageCacheSize
Public Property  ImageCacheUseDisk
Published Property  IOOptionsEx
Public Property  JobsRunning
Public Property  JobsWaiting
Public Method  LoadFromFileOnDemand
Public Method  LoadSnapshot
Public Property  LookAhead
Public Property  MaintainInvisibleImages
Public Property  PortableDevices
Public Method  ReloadImage
Public Method  SaveSnapshot
Public Method  Seek
Public Method  SetImageFromFile
Public Method  SetImageFromStream
Published Property  ThreadPoolSize

Selections
Public Method  BeginSelectImages
Public Method  CenterSelected
Public Property  CheckThumbBoundsOnSelect
Public Method  DeleteSelectedImages
Public Method  Deselect
Published Property  EnableMultiSelect
Public Method  EndSelectImages
Public Method  IsSelected
Public Method  MoveSelectedImagesTo
Public Property  MultiSelectedImages
Public Property  MultiSelectedimagesCount
Public Property  MultiSelectedImagesList
Public Property  MultiSelecting
Published Property  MultiSelectionOptions
Public Method  SelectAll
Public Property  SelectedFilename
Public Method  SelectedFilenames
Public Property  SelectedImage
Public Property  SelectedImageAlwaysVisible
Published Property  SelectionColor
Published Property  SelectionWidth
Public Property  SelectionWidthNoFocus
Public Method  SelectSeek
Public Method  UnselectImage
Published Property  VisibleSelection

Checkboxes
Published Property  Checkboxes
Public Property  Checked
Public Method  CheckedCount
Public Property  CheckboxPos
Public Method  SetCheckboxParams
Public Method  CheckAll
Public Method  UncheckAll

User Interaction
Public Property  Gestures
Public Method  GetImageVisibility
Public Method  ImageAtGridPos
Public Method  ImageAtPos
Public Method  InsertingPoint
Public Method  IsVisible
Published Property  KeyInteract
Published Property  MouseInteract
Published Property  MouseWheelParams (Default)
Published Property  MouseWheelParamsAlt (Ctrl Key)
Published Property  PopupMenus

ScrollBars
Public Property  CurrentScrollBars
Public Property  HScrollBarParams
Published Property  ScrollBars
Public Property  ScrollBarsAlwaysVisible
Public Property  VScrollBarParams

Single Frame View
Published Property  DisplayMode (Enable single frame view)
Public Property  Playing
Public Property  PlayLoop
Public Property  PlaySpeed
Published Property  TransitionDuration
Published Property  TransitionEffect
Public Property  TransitionRunning
Public Property  VisibleFrame

Other
Public Method  CalcGridHeight
Public Method  CalcGridWidth
Public Method  DesignTimeView
Published Property  DrawVersion
Public Method  IEBeginDrag
Public Method  IEEndDrag
Published Property  ImageEnVersion
Public Method  LoadProperties
Public Method  SaveProperties
Published Property  StoreType
Public Method  Update

Internal
Public Method  FillFromDirectory
Public Method  FillFromList
Public Method  Sort


Events

Folder Events
Event  OnAutoRefresh
Event  OnFolderChanging
Event  OnFolderChanged

User Interaction Events
Event  OnActionExecute
Event  OnCheckboxClick
Event  OnDropFiles
Event  OnEditText
Event  OnImageDeselect
Event  OnImageSelect
Event  OnImageEnGesture
Event  OnMouseEnter
Event  OnMouseLeave
Event  OnSelectionChanging
Event  OnZoomIn
Event  OnZoomOut

Loading Events
Event  OnAllDisplayed
Event  OnGetLoadFilename
Event  OnImageIDRequestEx
Event  OnImageIDRequest
Event  OnImageLoaded
Event  OnIOProgress
Event  OnWrongImage

Paint Events
Event  OnAnimationText
Event  OnBeforeImageDrawEx
Event  OnBeforeImageDraw
Event  OnDrawProgress
Event  OnGetText
Event  OnGetTextEx
Event  OnImageDraw
Event  OnImageDraw2
Event  OnImageOut

Other Events
Event  OnAcquireBitmap
Event  OnAfterEvent
Event  OnCreateImage
Event  OnCreateParams
Event  OnCustomSortCompare
Event  OnDestroyImage
Event  OnFilter
Event  OnFinishWork
Event  OnGetHint
Event  OnImageAdd
Event  OnImageAdded
Event  OnImageAtPos
Event  OnPlayFrame
Event  OnPrintPage
Event  OnProgress
Event  OnShowDialog
Event  OnUndoRedo
Event  OnViewChange

 Unique to TImageEnFolderMView