Integration module - SPIntegrationInterface
This module enables to integration of script files into SP's interface.
Editor toolbar integration
One of the possibilities to use scripts in SP is to register them as Editor toolbar buttons. Such scripts are
launched when the user clicks on the particular button on the toolbar.
It's possible to register multiple buttons in the same script, just use
different expressions for each button.
Registration function:
register_toolbar_script(caption, hint,
image_index, script_file,
expression)
- Register a script as a toolbar button in Editor window (Script
toolbar).
- caption: caption of the button
- hint: hint of the button
- image_index: index of image to use for
the button (-1 when no image shall be used)
- script_file: path to the script file
(e.g. c:\script.rb)
- expression: the exact launch expression
that should be called when the script is loaded (e.g. MyCoolClass.my_cool_function(3.14))
Example:
SPIntegrationInterface.register_toolbar_script('Button',
'Hint', 10, 'c:\script.rb', 'my_cool_script')