ImageEn, unit iemview

TImageEnMView.OnSelectionChanging

TImageEnMView.OnSelectionChanging


Declaration

property OnSelectionChanging: TIESelectionChangingEvent;


Description

Occurs prior to a change in the selected frame/thumbnail due to user action (i.e. mouse or keyboard).
This can be used to prevent changing of a selection (e.g. due to the current selection not being saved).

OnSelectionChanging occurs during the selection process, whereas OnSelectionChanged occurs after the change (so the selection index and count will be valid).


Example

procedure TfMain.ImageEnMView1SelectionChanging(Sender: TObject; NewIndex: Integer; var Allow: Boolean);
begin
  // Don't allow changing of the selection if the user cancels saving of the selected image
  if fSelectedImageChanged and (PromptToSaveSelectedImageChanges() = False) then
    Allow := False;
end;