PDFium Delphi Component 文件

OnFormCursor 事件

元件: TPdf  ·  單元: PDFium
當表單層為指標下的欄位要求游標形狀時引發

Syntax

property OnFormCursor: TPdfFormCursorEvent read FOnFormCursor write FOnFormCursor;

Description

OnFormCursor 在互動式表單層詢問應顯示哪個游標時引發。處理常式會收到型別為 TPdfFormCursor 的已解碼 Cursor(pfcUnknown、pfcArrow、pfcSizeNESW、pfcSizeNWSE、pfcVerticalBeam、pfcHorizontalBeam、pfcHand)、原始的 NativeCursorType 代碼,以及 var Handled 旗標

設定 Handled = True 可套用主機專屬的游標;未指定處理常式或 Handled 保持 False 時,元件會把解碼後的值映射到對應的 VCL 游標

Remarks

    • 處理常式簽名:procedure(Sender: TObject; Cursor: TPdfFormCursor; NativeCursorType: Integer; var Handled: Boolean) of object
    • 需要表單主機回呼已完整安裝;若事件從未引發,請檢查 FormHostCallbacksComplete

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