PDFium Delphi Component Docs

OnFormCursor event

Component: TPdf  ·  Unit: PDFium
Fires when the form layer requests a cursor shape for the field beneath the pointer

Syntax

property OnFormCursor: TPdfFormCursorEvent read FOnFormCursor write FOnFormCursor;

Description

OnFormCursor fires when the interactive form layer asks which cursor to show. The handler receives the decoded Cursor of type TPdfFormCursor (pfcUnknown, pfcArrow, pfcSizeNESW, pfcSizeNWSE, pfcVerticalBeam, pfcHorizontalBeam, pfcHand), the raw NativeCursorType code, and a var Handled flag

Set Handled = True to apply a host-specific cursor; when no handler is assigned or Handled remains False, the component maps the decoded value onto the matching VCL cursor

Remarks

    • Handler signature: procedure(Sender: TObject; Cursor: TPdfFormCursor; NativeCursorType: Integer; var Handled: Boolean) of object
    • Requires the form host callbacks to be complete; check FormHostCallbacksComplete when the event never fires

Example

procedure TMain.Pdf1FormCursor(Sender: TObject; Cursor: TPdfFormCursor; NativeCursorType: Integer; var Handled: Boolean);
begin
  if Cursor= pfcVerticalBeam then begin
    Screen.Cursor := crIBeam;
    Handled := True;
  end;
end;

See Also