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 索引 |
| TriggerEvent | PDF 触发事件名称,例如 '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