<< Click to Display Table of Contents >> Navigation: Tasks > ActionModes |
The "ActionMode" controls how the user can interact with the editor.
The ActionMode can be controlled by the actions as described with the sample application or it can be changed with this command: COMPDF_SetActionMode = 557
This replaces the old command "SelectMode"
COMPDF_SetActionMode expects and optional string parameter and an integer parameter which selects the mode:
0 wpacUndefined, // ActionMode was not used yet
1 wpacClickAndPan, // Standard Mode
2 wpacSelectPage, // Select page by click
3 wpacSelectObjects, // Select objects
4 wpacSelectObjectsLocked, // Select objects, does not move them
5 wpacFillForms, // Like wpacClickAndPan and allow widgets to be changed
6 wpacDrawFrameAndZoom, // Zoom to rectangle, Copy rectangle, reset to wpacClickAndPan
7 wpacDrawFrameAndCopyBitmap, // Copy rectangle, reset to wpacClickAndPan
8 wpacSelectText, // Select text and invert visual
8 wpacDrawFrameAndCopyText, // Draw a frame and copy the text within
10 wpacSelectTextAndColor, // Select text and highlight.
11 wpacSelectTextAndBlack, // Select text and black it out
12 wpacSelectTextAndDelete, // Select text and delete (reserved)
13 wpacDrawObject, // Draw a frame, create an object. Uses 2nd parameter
14 wpacDrawObjectContinue, // Draw a frame, create an object.
// Uses 2nd string parameter. Continue drawing
15 wpacDrawAnnot, // Draw a frame, create an Annotation. Uses 2nd parameter
16 wpacDrawAnnotContinue, // Draw a frame, create and the next ...
17 wpacDrawField, // Draw a frame, create an Annotation. Uses 2nd parameter
18 wpacDrawFieldContinue, // Draw a field, create, and the next
19 wpacDrawFrameAndEvent, // Draw Frame and trigger the event
The string parameter is used when creating objects, it can contains information such as the color or the text.
The VCL implements 3 methods to work with the ActionMode.
SetActionMode can be used to change the action mode and also sets the string parameter.
procedure SetActionMode( aActionMode : TWPViewpdfActionMode; aActionParam : String = '' );
Read the current action mode - this is useful to update the GUI
function GetActionMode : TWPViewpdfActionMode; overload;
Read the current ActionMode parameter
function GetActionMode(var aActionParam : String) : TWPViewpdfActionMode; overload;