OnAction

表單、互動

描述

TPDFlibFormSession

TPDFlibActionInfo

/Fo 即將執行可用的 Widget 動作時 此回呼會接收 Widget 索引、單一字元的 PDF 觸發事件,以及描述已設定動作的具型別 /Bl;該動作會先在 Widget 上查詢,若 Widget 本身未帶有動作,則改在其基礎欄位上查詢 透過此回呼觀察到的觸發事件包括焦點轉換時的 /K 與 /V、選取範圍編輯與選擇變更時的 /F、提交期間的 /E 與 /X,以及滑鼠指標互動期間的 /D、/U、

Allow 與 False 只有當實際設定了動作時才會引發此回呼;將

宣告

property OnAction: TPDFlibFormSessionActionEvent;

處理常式參數

Sender分派該動作的工作階段
FieldIndex動作所屬的欄位或暫時 Widget 索引
TriggerEventPDF 觸發事件名稱,例如 'Fo'、'Bl'、'K'、'V'、'F'、'E'、'X'、'D' 或 'U'
ActionInfo已設定動作的具型別描述
Allow否決旗標,預設為 True,設為 False 可拒絕擱置中的作業

範例

procedure TForm1.SessionAction(Sender: TObject; FieldIndex: Integer;
  const TriggerEvent: AnsiString; const ActionInfo: TPDFlibActionInfo;
  var Allow: Boolean);
begin
  if TriggerEvent = 'V' then
    Allow := ValidateBeforeCommit(FieldIndex);
end;

另請參閱

DispatchAction, TPDFlibActionInfo, OnFocusChanged, OnTextEdit, OnValueChanged, ExecuteFormFieldScript