PDFedit
PDF editor pro UNIX / PDF editor for UNIX

Wiki : CallbackQs

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

callback.qs


This script file contain callback functions and some helper functions used by these functions.

onChangeRevision()

This function is called after active revision of document is change.
Just prints message into console about revision change, as no extra handling is necessary.

onEmptyFile()

This function is called after the editor is opened without specifying any document on commandline (without opening any file) or if the current file is closed.
It will check menus and toolbars to enable/disable items as necessary.

onLoad()

This function is called after document is opened.
It will show first page of document and check menus and toolbars to enable/disable items as necessary.

onLoadUser()

This function is called after document is opened (after onLoad() is called).
It is empty, it is up to user to override this function with own one.

onLoadError()

This function is called after an error occured while trying to load a document.
It print out warning in console and show a messagebox with the warning text.

onPageChange()

This function is called after changing to another page in the preview window.
It will update available fonts in the font selection box.

onPageDelete()

This function is called after pressing "delete" key while in preview window.
Currently the implementation does nothing, as the required functionality is handled by Delete key being shortcut for deleting items in the object tree

onPageRightClick()

This function is called after clicking with right mouse button in window with page preview.
It will show a popup menu offering to save area or entire page as image.

onTreeLeftClick()

This function is called after clicking with left mouse button on any item in tree window.
This script function does nothing, basically leaving left click to work as usual (changing current item).

onTreeRightClick()

This function is called after clicking with right mouse button on any item in tree window.
It will examine selected item and show appropriate popup menu.

onTreeMiddleClick()

This function is called after clicking with middle mouse button on any item in tree window.
Currently the effect is forcing the item to reload itself, updating the state from state of edited document. Items should usually update themselves automatically, so this is meant mainly for debugging.

onTreeDoubleClick()

This function is called after doubleclicking with left mouse button on any item in tree window.
If the item is page, the preview window will be set to show that page

onTreeSelectionChange()

This function is called after selection in tree changes.
It will check menus and toolbars to enable/disable items as necessary, based on what is selected.

onValueChange(name)

This function is called after some of special tools change its value because of interaction. Parameter is name of the special tool. Color selection tool calls this after user select some color in it, edit tool calls this after user presses enter or leaves the control, number tool calls this after user presses enter or selects some of predefined numbers, select tool calls this after changing the selection.
It will check if the text have changed and update corresponding text operator and reload current page if necessary

onConsoleStart()

This function is called in commandline mode after calling all scripts specified in commanline parameters - unless some of the scripts exit the application prematurely, for example by calling exit().
This one is not present in the file, it is present only in scripts for console mode.

Categories
Scripting

There are no comments on this page. [Add comment]