Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

onSaveSubPreset(section)

Description

This callback function is called when saving a subpreset with a corresponding preset template. The callback will only be called if the scope of the preset template is set correctly.

  • If the MacroPage with the preset template is attached to an element other than the script module (e.g., the program), the scope of the preset template must be set to the script module (e.g., @0:Script Module).
  • If the MacroPage with the preset template is attached to the script module itself, the scope does not need to be set.

In addition, you need to define a section. When you save a subpreset the section will be passed on from the preset template to the callback. You can manage different subsets of parameters by using the section as condition for an if statement that stores only the parameters of interest. The last statement of the callback should be the return statement with the data.   The data returned by the callback will be stored in the subpreset. When the subpreset is restored, the onLoadSubPreset callback will receive the stored data. The data can be of any type, but it is common practice to use a table that can easily be extended with more data.

Scope and section are template parameters of the preset template. They can be set in the MacroPage Designer on the properties pane of the preset template.

Available in: Controller.

Arguments

sectionThe section as defined in the corresponding preset template.string

Return Values

The returned data will be stored in a subpreset.

Example

print("Put your example code here!")

See Also: onLoadSubPreset

  • No labels