3 Replies Latest reply on Oct 19, 2012 1:06 PM by philmodjunk

    New Window Problem...

    heath

      Title

      New Window Problem...

      Post

           Hello,

           I have the following script that is assigned to a button on my main spreadsheet layout:

             
      •           Go to Layout ["Crush"(Cylinders)]
      •      
      •           New Window [Name: "Cylinders Due"; Height:600; Width: 800; Top: 16; Left:16; Style: Document]

            

           I then have a script that is attached to the "crush" report layout.  It was set under Layout Setup to launch "OnLayoutEnter".  The script is as follows:

             
      •           Show/Hide Toolbars [Show}
      •      
      •           Enter Find Mode [Restore]
      •      
      •           Set Field [Cylinders::crush date; Get (CurrentDate)]
      •      
      •           New Record/Request
      •      
      •           Set Field [Cylinders::Crush Result; "<"
      •      
      •           Set Error Capture [On}
      •      
      •           Perform Find []
      •      
      •           Enter Preview Mode []

            

           Everything works great, for the most part, but I have one major problem.  When the new window opens, the main layout window adjusts to the same size as the new window.  Furhtermore it changes to the layout as what is in the newly gereated window, thus creating two 600x800 windows showing the same report layout.  I would like the main layout from where the initial button is pushed to remain untouched and maximized and simply have the report to appear in its' own window in front until such time as the user closes it.  Second Question:  I have also noticed that since using the afformentioned scripts, when I first load the database after entering user/password, the main entry window opens to the same size as indicated in my script.  There is no association to the script in anything else but the "Crush" layout.  Thus,  I don't know why it does not load maximized like it use to.

           Thanks in advance,

           Greg

            

        • 1. Re: New Window Problem...
          philmodjunk

               I can see that you are using windows and that you keep your windows maximized or the undesirable window size change would not be an issue.

               But first, change the order of your script steps:

          New Window [Name: "Cylinders Due"; Height:600; Width: 800; Top: 16; Left:16; Style: Document]
          Go to Layout ["Crush"(Cylinders)]

               That will change only the new window to the "Crush" layout.

               You can't eliminate the size change (When the window drops out of "maximized" state, it revers to the most recently specified window dimensions in force the last time the window was not maximized.) but you can  minimize it by using resizing the original window with the Move/Resize Window script step and using get ( ScreenHeight) and get ( ScreenWIdth ) to resize your window back out to the largest dimensions possible for an unmaximized window. You then need to re-maximize windows once the new window has been closed. (Either that or keep your windows unmaximized from the start...)

          • 2. Re: New Window Problem...
            heath

                 Hi Phil-

                 Thanks for your quick reply once againsmiley.  The change of order took care of the first problem.  I Can't believe I missed trying that, but thank you nonetheless.  I am not a big Windows user; I do all my setup on Mac's and then transfer.  Thus, there are some issues between operating systems that I am still getting aquainted with. So based on your comment I would take it that most people setting up for a Windows platform would not leave windows in a maximized state, rather have them all floating from the start?  Or in your opinion is it better to have a maximize script on every layout to force them back to that state.  The other question I would have is how, when a user clicks the red "X" to close a window, do you initaite a script at that point to maximize the window behind that has been floated and downsized?  You obviously can't attach a script to the "X", so how would I go about this?

                 Thanks,

                 Greg

                  

                  

            • 3. Re: New Window Problem...
              philmodjunk

                   I prefer maximized windows myself but also recognize that this presents issues not always easy to resolve. I find nesting all windows inside a larger application window with its extra scroll bar a pretty awful looking interface and one that can even cause confusion for my users when they try to scroll part of a layout into view and use the wrong scroll bar.

                   I usually use the following rules of them and accept a "twitch" in my window sizes that I'd really prefer to do without:

                   1) I use a script to maximize windows when the file initially opens.

                   2) I try to limit my interface design to two windows--a screen filling background or "parent" window and a single smaller "child" window that functions as a modal "dialog box" type of window that is only open for a short time.

                   3) When developing in "Pre-12" versions, I force a new window to be modal by creating an infinite loop with Pause/Resume [Indefinitely] the only step inside the script loop and with user aborts disabled. All scripts/buttons that close the child window include Halt Script in order to escape the infinite Loop. In FileMaker 12, I can just specify the new "modal" window property and skipt this added scripting.

                   4) Since I use FileMaker Advanced, I create a "Floating Window" custom menu set. I remove most menus from this step and replace the close window menu option with a script that closes the window, maximizes windows and then does a Halt Script (In Pre-12 versions) to escape that loop. With this custom menu installed on the layout used with the Child window, clicking the close window "x" automatically re-maximizes the windows.

                   You can see this process in action if you download and examine the Known Bugs List database.