Docs de PDFiumPas

OnSelectionChange event

Esta entrada API conserva identificadores, firmas, bloques de código y términos PDF en su forma original.
Componente: TPdfView  ·  Unidad: PDFium
Fires when the materialised text selection ranges actually change.

Sintaxis

property OnSelectionChange: TNotifyEvent;

Descripción

Notifica al anfitrión que la selección de texto ha cambiado. Se dispara en cada transición en la que los FSelection rangos difieren del estado anterior — incluyendo vacío → no vacío (un arrastre empieza a capturar caracteres), no vacío → vacío (ClearSelection, page change, deactivate, document switch), and any range mutation in between (Shift+Right, mouse-move drag extension, double-click word expansion).

Does NOT fire when the same selection is set again (e.g. calling SelectAll dos veces en la misma página). La comprobación interna de igualdad de rangos corta la re-aplicación idéntica, así que el evento puede conectarse directamente al texto de la barra de estado o al estado habilitado de un botón sin necesidad de antirrebote

Notas

Ejemplo

procedure TForm1.PdfViewSelectionChange(Sender: TObject);
begin
  StatusBar1.Panels[0].Text :=
    Format('%d chars selected', [PdfView1.SelectionCharCount]);
  CopyButton.Enabled := PdfView1.HasSelection;
end;

Véase también

AllowUserTextSelection, HasSelection, SelectionCharCount, SelectedText