Custom HTML Prompt WindowPositionController

In KM10, there's a problem with being able to save and restore window positions.

I wrote a Javascript "class" to help solve that problem. I don't have time to properly document it, but it works well.

Line 16 shows the parameters, and line 110 shows a typical way to construct it. "SaveWindowPositionExample_Data" is the name of the KM variable that holds the saved position data.

Line 114 shows how to set the starting position. The parameters 400, 200 are the default width and height.

The lines 117-125 show how to save the position data.

The other parameters shown in line 16 are hopefully self-explanatory, with the possible exception of "debugLogFunction", which you can ignore.

Here's the full example. You can copy the "WindowBoundsController" code and paste it into your Custom HTML Prompts.

CustomHTMLPrompt Window Position (1.7 KB)

If you have questions, just try playing around with it first to see if you can answer your own questions. Otherwise, post them here, and I'll try and answer them.

1 Like