Is it possible to put source for custom property in a separate file if the property affects multiple controls?
I'm creating a number of new custom css Button widgets and they all need a response property.
Initially, I was including the addCustomProperty call, for the new response property, in the source for each widget, specific to that widget, as below.
Code: Select all
[b]cssBackButton.js[/b]
pui.addCustomProperty({
name: "response",
type: "long",
controls: ["css back button"],
category: "Identification",
help: "Specifies a response indicator that is returned to your program when the element is clicked.",
});
[b]cssExitButton.js[/b]
pui.addCustomProperty({
name: "response",
type: "long",
controls: ["css exit button"],
category: "Identification",
help: "Specifies a response indicator that is returned to your program when the element is clicked.",
});
[b]cssPauseButton.js[/b]
pui.addCustomProperty({
name: "response",
type: "long",
controls: ["css pause button"],
category: "Identification",
help: "Specifies a response indicator that is returned to your program when the element is clicked.",
});
I eventually realised that the response property only needed specifying in the source for one of the 3 widgets, leading to my question; as multiple controls require this property, can the call to addCustomProperty be stored in its own .js source file which will automatically be consumed by designer and applied across all controls that need it?
Am I using the correct methods/techniques or is there a better technique for doing this kind of thing?
Code: Select all
[b]cssExitButton.js[/b]
pui.addCustomProperty({
name: "response",
type: "long",
controls: ["css back button", "css exit button", "css pause button"],
category: "Identification",
help: "Specifies a response indicator that is returned to your program when the element is clicked.",
});
Regards,
Mark