There’s a PROCEDURE template type called “UserControl” which will generate an object that can be re-used via a control template onto other windows. It’s not 100% baked, and not documented (that I know of), but it’s there.
Many years back, I sent this demo to SV, thinking it would be a cool thing to be able to do, and I think that’s where UserControl came from. jswidget20050302.zip (4.3 KB)
Here is a very basic example that I created to test UserControl, but it doesn’t do much. (Hope it’s the right one) https://www.dropbox.com/s/5o45ceicwj7os7z/UserControlExample.zip?dl=0