Actions

<< Click to Display Table of Contents >>

Navigation:  Commands >

Actions

WPViewPDF V4 implements "Actions".

 

These are predefined commands which combine several other commands. They can be executed by using an ID but also by specifying the name. The PDF engine can also provide information if a command is active right now, i.e. to highlight a button or if it is disabled.

It is possible to retrieve the name, a caption and also a hint. It is possible to localize the strings using an XML script.

 

The action IDs consist of the group and the operation id. The group is encoded into the high word of the id, the operation into the low word. The operation 0 in group 0 does nothing, this means id 0 is void.

 

This command executes an action when you know the action name, such as "FileOpen". A String parameter can be attached to the action name using "=", i.e. "FileOpen=c:\test.pdf"

 

COMPDF_ACTION = 580;

 

This command executes an action when you know the action id

 Command(COMPDF_ACTIONNR, 1, "c:\test.pdf") will open a PDF file.

 

COMPDF_ACTIONNR = 581; // HighWord=Kind, LowWord = Operation, StrParam is passed

 

This command is not used right now:

 

COMPDF_ACTIONEX=582; // Extended Action - with param as record   (RESERVED)

 

This command is used to read information about an eaction:

 

COMPDF_ACTION_READ = 583;

 

 strparam="xml" - read all strings and commands as XML list!

 strparam="kinds" - read count of kinds

 strparam="kindX" - read count of operations in kind X

 strparam='caption", IntParam = HighWord=Kind, LowWord=Operation. Result can be ''

 strparam='hint", IntParam = HighWord=Kind, LowWord=Operation. Result can be ''

 strparam='command", IntParam = HighWord=Kind, LowWord=Operation. Result can be ''

 

This command writes the XML definition. Caption and hint can be modified.

If IntParam<>0 it is expected to be the action ID. Then you can use string parameter such as

caption=, hint=, command=.., option=.. to modify a certain action.

 

COMPDF_ACTION_WRITE = 584;

 

This command read action flags. The flags are used to create a menu automatically:

bit 1: need separator after this item

bit 2: Should not display a menu item for this action

bit 3: Requires WPViewPDF PLUS

bit 4: Requires permission to save a PDF file

bit 5: This is a global operation which affects all viewers

bit 6: This action should create a submenu with all following actions until one with bit 1 flag in it.

 

COMPDF_ACTION_READFLAGS = 585;

 

Note: The procedure WPPDFViewerInitMainMenu defined in WPViewPDF4.pas uses the flags.

 

This command read action states: 1=checked, 2=disabled

 

COMPDF_ACTION_READSTATE = 586