Instead of trying to mess with the FM Window menu, use Custom Menus to build a replacement/substitute "Window" Menu with the custom commands you want to allow.
I thought about that, but what I'm after is actually the list of open windows at the bottom of the window menu. From what I can see there isn't a standard way to show just those, is there?
Just create a script to open a dialog with this as it’s context[ Substitute ( Trim(WindowNames) ; ¶ ; "|" ) ] to replace the window list. Then add this to your custom menu items.
Sorry, no. The only Windows Menu commands available for building your own menu are:
- Arrange Icons
- Bring All to Front
- Cascade Windows
- Hide Window
- Tile Horizontally
- Tile Vertically
You can also create a command from scratch to run a script or script step, but I don't see how either of those could be used to generate an accurate list of existing windows which would be clickable.
You could use the insert sub-menu item in your custome menu for "Show Window>" to enable going to windows which are available in the background, but that doesn't list the currently visible open windows for navigation purposes.
Can you use that list in some way to navigate to the correct window?
Sure Stephen, since you are scripting the list. Just figure out a way to trap the user's response and it's very useful.
ex. send the set to a global and use the virtual list technique to populate the portal in a layout called by the menu item. Collect the user click on the portal row and presto..... go to object/window/layout??? however you designate the window movement.
It can feed a variety of implementations. Being called from the menu it is always fresh
Also, since it is a menu item attach a shortcut to the menu definition and you don't even have to use the menu to get the list of open windows. Call that an added bonus.
Attached should be a file with an idea for you to consider.
The developer needs to create an individual Menu Item (in a custom Menu) for each possible window that may be open. This means that there will be an upper bound to the number of open windows that can be shown in the menu. In the sample file, I have allowed for up to 21 windows.
The basic gist of it is that you use calculations to determine the Menu Item names, as well as whether or not the Menu Item in question should be installed. The calculations make use of the WindowNames function to determine the above. A script parameter on each Menu Item script passes the target window name to a script that navigates to that window.
- Note that I believe that unless you go to great lengths to overcome the situation, the script will fall short of perfect if multiple windows share an identical name.
- I have not tried this out on the Win platform.
WindowMenuSubstitute01.zip 11.8 K
Just tested it on Windows, and it looks to work like a champ! Thanks so much!!
BTW, you might consider submitting this to modularfilemaker.org
Very glad to know that it is also working on Windows. Thank you for the feedback.