The trick is to pause the script and lock the user out of any actions that could cancel the script.
Take a look at this file you can download: http://www.4shared.com/file/8orL8apk/FMP_Bugs.html
Both the edit button on the change history portal and the Find Button at the top of the layout use just such a floating window approach. You can check over the scripts to see how it was done.
The critical part of a floating window is that at least one button on it must either have Halt script as the option (for the Current Script drop-down), or have Halt Script at the end of one of the button's script (as Phil did). Do this 1st, or risk being caught in an "endless loop". Best to work on a copy of your database until you're sure it's right.
I also used a custom menu to get the close button in the corner of the window to work. It also has a halt script in it to make sure you don't get trapped in the loop.
Thank you Phil and Fenton the link to the example file is great was great to see how the "floating window" is used. However I couldnt figure how to review the scripts seems the file is locked? Were you suggesting I could see the code or just see how the file worked. Love to see code if I can. Since 11 has been released I am very excited using FM and FMtouch this is such a great forum.
Once again thanks for the great info and quick replies.
Oops must have been in the find mode window when I tried to check on the scripts. Of course afterward posting I soon discovered I was in wrong window to find the manage scripts. Foiled again.
Ok I understand the concept after reviewing your files but I am still stuck on one issue. What I would like is to have both windows the floating and B window operable to the user. I am a salesman and ideally I would like to have the inventory floating while I peruse other layouts in my DB. The inventory is always a reference point for my work as I do use portals in some of the layouts but the Floating accesibility would be perfect to copy from the "floating inventory" and paste in other layouts as needed.
Is there a different file I should look at? I assume the FM Help window uses this type of coding.
Thanks for direction.
If you can click on and use the non-floating window, then the "floating" window is no longer "floating." It's just another small window. Which if OK, as far as it goes. But if in the same area as the main window then it could become covered by it. Once again, OK; but the problem is if you click again, in the main window, whatever button you had for the "small" window. You likely don't want to create 2 (or more) small windows.
So what I do is check for the small window first, by name. If it exists, then close it. Basically, you use the same script which produced the small window in the first place, but with a test near the beginning to see if it's already open, closing it if it is, so the rest of the script works as expected.
Alternatively you could just "select" the small window. But since its content likely depends on the context of the main window, you need to change it anyway; so closing it first seems the simplest solution.