3 Replies Latest reply on May 26, 2010 8:45 AM by philmodjunk

    Opening and Closing new windows

    aammondd

      Title

      Opening and Closing new windows

      Post

      Im opening a new window to display a report parameters layout.

       

      What kind of things should i keep in mind when closing the window and navigating back to the original window and a new layout based on the report parameters.

       

      If I simply close the window will it go to the previously active window?

       

      I have 2 buttons on my layout 1 to cancel and one to generate the report . The cancel just closes the window and returns the user to the Main Menu layout in the file Should I select window Get(Filename) to ensure I activate the window?

       

      Ive never worked with this open new window and would appreciate some tips.

       

       

       

       

        • 1. Re: Opening and Closing new windows
          philmodjunk

          Closing the top window returns control to the window immediately "beneath" it. Which is normally the window that was current when you used New WIndow to create a new window.

           

          Unless you are doing something unusual with your windows, simply closing the new window will activate the previous window.

           

          The main detail to look out for with the new window command is that there are cross platform differences. If the parent window is maximized on a WIndows machine, new window resizes the parent window--changing it's size to the most recent non maximized window size setting--which can be very different from what you want. You have to add some extra code to resize the parent window to almost maximized and then maximize that window when you close the popup to keep your windows in their maximized state.

          • 2. Re: Opening and Closing new windows
            aammondd

            So if Im setting the window sizes each time its not a problem

             

            Is it good practice to close the window Im going to open before I open it to help eliminate duplicate windows confusing the user?

             

            I was noticing that because of positioning etc in testing I wasnt realizing that I had multiple new windows so it appeared my "close" button wasnt working.

             

            is there anything to prevent a person from leaving an active window until they have dealt with it in some fashion?

            • 3. Re: Opening and Closing new windows
              philmodjunk

              I always make my small pop-up windows "Psuedo-Modal" to keep users from losing them behind the larger background window.

               

              Open the new window.

              Select the layout desired

              Hide/lock the status area

              Disable user aborts

              Loop

                Pause the script

              End Loop

               

              With the script paused and no way for the user to continue/cancel the script, the window behaves like a modal dialog. Buttons and triggered scripts on the pop-up window then use one method or another to halt this paused script. (You can either use the Halt current script option on a button or end your script with the Halt Script step to terminate any paused scripts.)

               

              With filemaker advanced, you can also use a custom menu with your pop-up so that close window from the filemenu also halts the above script. (You replace the close window command with your own script.) This also enables the close button in the corner of your window as long as it's not part of a run time solution.