TPDFlibViewerAction

Data types, viewer interaction, actions

Description

Base class of the ready-made action components that drive a TPDFlibViewer from toolbars, menus and buttons

The action holds the target viewer in its Viewer property and keeps Enabled in sync with the document state: Update refreshes Enabled through the virtual DoUpdate, whose default implementation requires an assigned viewer with at least one page

Execute gives an assigned OnExecute the first say, mirroring standard TAction semantics; otherwise it runs the subclass command through the abstract DoExecute when DoUpdate allows

The subclasses declared in PDFlibViewerActions cover page navigation, zooming, rotation, printing, file open and save, clipboard copy and the tool modes; RegisterActions publishes them in the losLab PDF category, and CreatePDFlibViewerDefaultPopupMenu assembles the standard viewer context menu from them

When the assigned viewer is destroyed, the Notification override clears Viewer automatically

Declaration

TPDFlibViewerAction = class(TCustomAction)

Key members

ViewerTarget viewer the action drives, published so it can be wired at design time
ExecuteRuns OnExecute when assigned, otherwise the subclass command
UpdateRefreshes Enabled from DoUpdate
DoUpdateProtected virtual availability check, the default requires an open document
DoExecuteProtected virtual abstract command the subclasses implement

See also

TPDFlibViewerActionClass, TPDFlibViewerModeAction, TPDFlibViewer, CreatePDFlibViewerDefaultPopupMenu, InstallPDFlibViewerDefaultPopupMenu