Behavior of push buttons.
You will find a general example for the use of behavior here.
Behavior of push buttons. Use the methods of this module to read and change the actions executed by push buttons.
static int get_actions(
ItemRef buttonRef,
int eventType,
ItemList actions)
DEPRECATED! Please use the function interactive::get_actions instead.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode |
static int get_action_event(ItemRef buttonRef, ItemRef actionRef)
DEPRECATED! Please use the function interactive::get_event instead.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode |
static int get_action_type(ItemRef buttonRef, ItemRef actionRef)
DEPRECATED! Please use the function interactive::get_task instead.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode |
static int get_action_data(
ItemRef buttonRef,
ItemRef actionRef,
int* eventType = 0,
char* eventName = 0,
int* enabled = 0,
int* sval1 = 0,
int* sval2 = 0,
int* sval3 = 0,
int* sval4 = 0,
int* sval5 = 0,
int* ival1 = 0,
int* ival2 = 0,
int* ival3 = 0,
int* ival4 = 0,
int* ival5 = 0,
IDTypeList* lval = 0)
DEPRECATED! Please use the function interactive::get_task_data instead.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode |
static int add_action(
ItemRef buttonRef,
int eventType,
int actionType,
ItemRef out_actionRef)
DEPRECATED! Please use the function interactive::add_action instead.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode |
static int change_action_data(
ItemRef buttonRef,
ItemRef actionRef,
...)
DEPRECATED! Please use the function interactive::set_task_data instead.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode |
static int move_action(
ItemRef buttonRef,
ItemRef actionRef,
int eventType,
int new_pos)
Move an action of a push button to a new event type and/or another position in the list of actions.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
buttonRef | ItemRef | - | Valid button reference. Use frame::get_multistate to retreive the push button of a document frame. |
actionRef | ItemRef | - | Valid action. Use behavior::get_actions or behavior::add_action to get action references. |
eventType | int | - | New event type for the action 0 : Leave untouched 1 : Mouse up 2 : Mouse down 3 : Mouse enter 4 : Mouse exit 5 : On focus (PDF) 6 : On blur (PDF) |
new_pos | int | - | 0-based new position inside the list of actions of eventType |
static int remove_action(ItemRef buttonRef, ItemRef actionRef)
Delete a push button action.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
buttonRef | ItemRef | - | Valid button reference. Use frame::get_multistate to retreive the push button of a document frame. |
actionRef | ItemRef | - | Valid action. Use behavior::get_actions or behavior::add_action to get action references. |
static int enable_action(
ItemRef buttonRef,
ItemRef actionRef,
int state)
Enable/disable oush button actions.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
buttonRef | ItemRef | - | Valid button reference. Use frame::get_multistate to retreive the push button of a document frame. |
actionRef | ItemRef | - | Valid action. Use behavior::get_actions or behavior::add_action to get action references. |
state | int | - | 0 : Disable 1 : Enable |
static int get_overlaycreator_type(ItemRef frameRef, int type)
Get the "Overlay Creator" of a document frame.
Name | Type | Default | Description |
Return | int | 0 : not an Overlay Creator object or error 1 : Hyperlink 2 : Slideshow 3 : Image sequence 4 : Video 5 : Audio 6 : Panorama 7 : WebView 8 : Pan and zoom 9 : Scrollable frame |
|
frameRef | ItemRef | - | valid object reference |
static int hyperlink(
ItemRef frameRef,
int showInFolio = 1,
int askBefore = 0)
Set the Overlay Creator properties for a hyperlink. To create a hyperlink object, please see at Adobe Help.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Pushbutton with "Go to URL" action |
showInFolio | int | 1 | Show URL in folio or in browser? 1 : Folio 0 : Browser |
askBefore | int | 0 | Ask before showing content in browser 0 : no 2 : yes |
static int slideshow(
ItemRef frameRef,
int autoStart = 0,
int tapEnabled = 0,
float startDelay = 0.0,
float intervall = 2.0,
int loops = 1,
int stopAtLast = 0,
int fade = 1,
float fadeTime = 0.5,
int wibeAble = 0,
int stopWipeAtEnd = 0,
int defaultSelected = 0,
int reverseOrder = 0)
Set the Overlay Creator properties for a slide show. To create a slide show object, please see at Adobe Help.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | State object with at least two states |
autoStart | int | 0 | Start slide show automatcally? 0 : no 1 : yes |
tapEnabled | int | 0 | Tap to start/stop? 0 : no 1 : yes |
startDelay | float | 0.0 | delay in seconds |
intervall | float | 0.0 | Intervall in seconds |
loops | int | 1 | Number of loops -1 : infinite loop |
stopAtLast | int | 0 | Stop at last state? 0 : no 1 : yes |
fade | int | 0 | Fade in? 0 : no 1 : yes |
fadeTime | float | 0.5 | Time to fade |
wipeAble | int | 0 | Wipe to change state 0 : no 1 : yes |
stopWipeAtEnd | int | 0 | Stopp at last/first state? 0 : no 1 : yes |
defaultSelected | int | 0 | Vor dem Abspielen ausblenden 0 : no 1 : yes |
reverseOrder | int | 0 | Show in reverse order? 0 : no 1 : yes |
static int sequence(
ItemRef frameRef,
char* folderPath,
int showFirst = 1,
int autoStart = 0,
int tapEnabled = 0,
float startDelay = 0.0,
int fps = 16,
int looping = 1,
int stopAtLast = 0,
int wibeAble = 0,
int stopWipeAtEnd = 0,
int reverseOrder = 0)
Set the Overlay Creator properties for an image sequence. To create an image sequece object, please see at Adobe Help.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Valid frame reference |
folderPath | char* | "" | Folder with the images. Image names must have sequence numbers like img001, img002, ... |
showFirst | int | 1 | Show first image in document? 0 : nein 1 : ja |
autoStart | int | 0 | Automatisch abpielen? |
autoStart | int | 0 | Start slide show automatcally? 0 : no 1 : yes |
tapEnabled | int | 0 | Tap to start/stop? 0 : no 1 : yes |
startDelay | float | 0.0 | delay in seconds |
fps | int | 16 | Speed in frames per second |
loops | int | 1 | Number of loops -1 : infinite loop |
stopAtLast | int | 0 | Stop at last image? 0 : no 1 : yes |
wipeAble | int | 0 | Wipe to change state 0 : no 1 : yes |
stopWipeAtEnd | int | 0 | Stopp at last/first state? 0 : no 1 : yes |
reverseOrder | int | 0 | Show in reverse order? 0 : no 1 : yes |
static int video(
ItemRef frameRef,
int autoStart = 0,
float startDelay = 0.0,
int showFull = 0,
int showControls = 0)
Set the Overlay Creator properties for a video.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Valid frame reference containing a video |
autoStart | int | 0 | Start video automatically? 0 : no 1 : yes |
startDelay | float | 0.0 | delay in seconds |
showFull | int | 0 | Show full format? 0 : no 1 : yes |
showControls | int | 0 | Tap controls to show? 0 : no 1 : yes |
static int audio(
ItemRef frameRef,
char* controlsPath = 0,
int showFirst = 1,
int autoStart = 0,
float startDelay = 0.0)
Set the Overlay Creator properties for a video.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Valid frame reference containing a sound |
controlsPath | char* | "" | Folder containing the controls (for instance a001_play.png, a002_play.png, ..., a001_pause.png, a002_pause.png, ...) |
showFirst | int | 1 | Show first image in document? 0 : nein 1 : ja |
autoStart | int | 0 | Start sound automatically? 0 : no 1 : yes |
startDelay | float | 0.0 | delay in seconds |
static int panorama(
ItemRef frameRef,
char* imageFolder = 0,
int showFirst = 1,
int startZoom = 70,
int rotateX = 0,
int rotateY = 0,
int minFOV = 30,
int maxFOV = 80,
int upLimit = -90,
int downLimit = 90,
int leftLimit = -180,
int rightLimit = 180)
Set the Overlay Creator properties for a panorama.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Valid frame reference. |
controlsPath | char* | "" | Folder containing the six images (z.B. a001.png, a002.png, ...) |
showFirst | int | 1 | Show first image in document? 0 : nein 1 : ja |
showFirst | int | 1 | Zuerst erstes Bild zeigen? 0 : nein 1 : ja |
startZoom | int | 70 | Start zoom |
rotateX | int | 0 | Start vertical |
rotateY | int | 0 | Start horizontal |
minFOV | int | 30 | Field of view : Minimum |
maxFOV | int | 80 | Field of view : Maximum |
upLimit | int | 30 | Upper limit if vertical pan No vertical pan : upLimit and downLimit both 0 |
downLimit | int | 80 | Lower limit if vertical pan |
leftLimit | int | -180 | Left limit if vertical pan No horizontal pan : leftLimit and rightLimit both 0 |
rightLimit | int | -180 | Right limit if vertical pan |
static int webview(
ItemRef frameRef,
char* url = "",
int autoStart = 0,
float startDelay = 0.0,
int transparentBackground = 0,
int userActionsEnabled = 0,
int scaleContentToFit = 0)
Set the Overlay Creator properties for a web view.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Valid frame reference. |
URL | char* | "" | URL |
autoStart | int | 0 | Start view automatcally? 0 : no 1 : yes |
startDelay | float | 0.0 | delay in seconds |
transparentBackground | int | 0 | Use transparent background? 0 : no 1 : yes |
userActionsEnabled | int | 0 | Allow user actions? 0 : no 1 : yes |
scaleContentToFit | int | 0 | Scale content to fit into frame? 0 : no 1 : yes |
static int image(ItemRef frameRef, int canZoom = 0)
Set the Overlay Creator properties for a web view.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Valid graphic frame reference. |
canZoom | int | 0 | Allow zooming? 0 : no 1 : yes |
static int scrollable(
ItemRef frameRef,
int direction,
int hideScroller,
int useDocPosition,
int exportFormat)
Set the Overlay Creator properties for a scrollable frame.
Name | Type | Default | Description |
Return | int | 0 or ErrorCode | |
frameRef | ItemRef | - | Valid frame reference with scrollable content. |
direction | int | - | Scroll direction 0 : automatically 1 : horizontal and vertical 2 : vertical 3 : horizontal |
hideScroller | int | - | Show scroll bar? 0 : no 1 : yes |
useDocPosition | int | - | Initial content position 0 : top left 0 : document position |
exportFormat | int | - | Export format in PDF articles 0 : Raster 1 : Vector (PDF) |
Imagine, you have a product with color variants. The variants are collected in one multi state object. And for every variant
you have a small button in the color to switch the state of multi state to the according image. Images and buttons are created
by build scripts.
The post action for the images creates the multi state object (Script I).
The post action of the button frames has to convert every frame to a push button with an "Go to state" action on mouse up.
// // Skript I // int main () { ItemRef mso = item::alloc (); ItemRef fr = item::alloc (); int states = 0; int i = 0;
if (!itemlist::length (gFrames)) return 0;
itemlist::create_multistate (mso, gFrames, 0); frame::set_script_tag (mso, "true", "WipeEnabled");
// Reverse states states = multistate::count_states (mso); for (i = 0; i < states -1; i++) { multistate::move_state (mso, states-1, i); }
return 0; }
// // Skript II // int main () { ItemRef fr = item::alloc (); ItemRef state = item::alloc (); ItemRef mso = item::alloc (); int stateID = 0; ItemRef btn = item::alloc (); ItemRef action = item::alloc (); ItemList li = itemlist::alloc (); int i;
if (!itemlist::length (gFrames)) return 0;
// // Take the first frame of the list of button frames. // Query sibling 'A' ... // ... and get the multistate parent of 'A' // itemlist::get (gFrames, fr, 0); frame::get_cometgroup_member (fr, "A", state); frame::get_multistate (state, mso, &stateID);
// For every frame of the list ... for (i = 0; i < itemlist::length (gFrames); i++) { itemlist::get (gFrames, fr, i);
// Make it a button itemlist::clear (li); itemlist::append (li, fr); itemlist::create_multistate (btn, li, 1); // This functions need a list!
// Add an action for event type "Mouse up" (1) //with action type "Go to state" (12). behavior::add_action (btn, 1, 12, action);
// Set action parameters behavior::change_action_data (btn, action, item::getint (mso), i, -1, -1); }
return 0; }
Alphabetic index HTML hierarchy of classes or Java