10 Replies Latest reply on Sep 12, 2013 2:55 PM by steve_ssh

    Customize the Window Menu?


      Hey everyone,

      I'm working on an application that I want to have hide the Window menu, since I have some extensive window management in scripts, and it shouldn't be needed. The app will create and close windows as needed. However some of my users want to be able to have quick access to all of their windows, and heavily use the Window menu. That's not a problem except for the "New Window" command. The Window menu is one of the few that we can't customize and deactivate options on. It's all or nothing. I can't even enable it in certain cases for certain users or not. It's just there or not. Have any of you run into this problem and gotten around it? I can't have users creating new windows because it will really screw things up. Thanks!


        • 1. Re: Customize the Window Menu?
          Stephen Huston

          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.

          • 2. Re: Customize the Window Menu?

            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?

            • 3. Re: Customize the Window Menu?

              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.







              • 4. Re: Customize the Window Menu?
                Stephen Huston

                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.

                • 5. Re: Customize the Window Menu?
                  Stephen Huston

                  Can you use that list in some way to navigate to the correct window?

                  • 6. Re: Customize the Window Menu?

                    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





                    • 7. Re: Customize the Window Menu?

                      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.



                      • 8. Re: Customize the Window Menu?

                        Hi Jared,


                        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.




                        Kind regards,



                        • 9. Re: Customize the Window Menu?

                          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

                          • 10. Re: Customize the Window Menu?

                            Hi Jared,


                            Very glad to know that it is also working on Windows.  Thank you for the feedback.


                            Very best,