ImageEn, unit iemview

TIESelectionChangingEvent


Declaration

type TIESelectionChangingEvent = procedure(Sender: TObject; NewIndex: Integer; var Allow: Boolean) of object;


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).
NewIndex will indicate the thumbnail that was clicked (MouseDown), mouse is over (MouseMove/MouseUp) or new position (keyboard events). It may be -1 for invalid positions, or -99 for "Select All".
Set Allow to False to prevent the change.


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;