6 Replies Latest reply on Apr 30, 2012 11:58 AM by jormond

    Modal Dialog Window Questions

    AllegroDataSolutions
      1. In attempting to use the new modal (dialog) window feature, I found that the only criteria the script step accepts is pixels. FMP12 doesn't use pixels anywhere else, so determining the size of the window from the rulers on the layout is something of an ordeal.
      2. The second problem has been around, I think, as long as you have been able to specify window size and positions. When the user is viewing a maximized layout and executes a script that opens a window, the layout is no longer maximized. This is behavior is jarring for MS Windows users, especially if the new window is supposed to function as a dialog. It's not the way most other Windows applications behave. I had hoped that the new modal window would function like a dialog functions in the Windows OS, since FMP is supposed to be cross platform.

       

      I don't typically have a need for layouts to function as dialogs in my solutions (though I need it for one that I am building now). If any developer who has used them has any ideas for a workaround, I'd be grateful if you would post them here.

       

      Thanks.

        • 1. Re: Modal Dialog Window Questions
          BruceHerbach

          Hi

           

          In answer to 1,  I work out the basic size I want and set it. Once the base size is determined for the dialog box,  I tend to reuse the same values.

           

          For #2,  I try not to let the user go to actual full screen.  Instead I script this and set it a few pixels (points?) smaller then full size.  This makes the transitions much smoother.

           

          HTH

          Bruce

          • 2. Re: Modal Dialog Window Questions
            AllegroDataSolutions

            Thanks, but I'm afraid those solutions aren't going to work for me. Having to arrive at the dimensions in pixels by trial and error is a very inefficiant way to work. And I don't think shrinking the size of the main window, even by just a couple of pixels is going to fool any Windows users.You get that second title bar (which, combined with the status area, wastes a lot of space). I have enough trouble fitting everything they want on a layout as it is.

             

            Unless anyone has a better idea, I'm going to have the script go a full screen layout that serves as a dialog. I had hoped the modal window attribute (which is clearly intended for dialogs) would actually look and behave like a real Windows dialog.

            • 3. Re: Modal Dialog Window Questions
              TomHays

              allegro wrote:

               

              1. In attempting to use the new modal (dialog) window feature, I found that the only criteria the script step accepts is pixels. FMP12 doesn't use pixels anywhere else, so determining the size of the window from the rulers on the layout is something of an ordeal.

               

              The rulers default to "in", but like the dimensions used in the Inspector, you can click on the "in" and it will change to "cm". Click on it again and it changes to "pt". "pt" is short for "points". From what I have observed with working with objects in layout mode, this is the same as "pixels" in the Window dimensions.

               

              You may find it useful to calculate the dimensions of the new modal window based on the current situation. The functions Get(ScreenWidth), Get(ScreenHeight), Get(WindowTop), Get(WindowHeight), etc., may be useful here. All of these functions return a result in pixels.

               

               

              -Tom

              • 4. Re: Modal Dialog Window Questions
                DavidZakary

                Something that may help is one of the many screen measurement tools out there - on the Mac, I use XScope all the time. Before we got multiple guides in FM 12, XScope's on-screen guide and ruler tools were invaluable. You can also draw out boxes to get measurements along with many other useful things.

                 

                Sounds like you're on Windows - I'm sure there is something similar out there.

                 

                While not the perfect solution that we need, this can help.

                • 5. Re: Modal Dialog Window Questions
                  BruceHerbach

                  Allegro,

                   

                  In shrinking the size of the window,  I find that it works because when I design/build the layout,  it is setup to fit in a specific size window.  Then allow for items to stretch and fill available space when it is appropriate.  As long as the elements of the layout don't exceed the window size,  you don't get scroll bars. 

                   

                  Ok,  That stated... In looking at the new window and GTRR set ups,  they are asking for Pixels.  This might possibly be considered a bug,  since the setup for a layout has been switched to points.  The saving grace, is that all of the other script commands are still in pixels.    So you can set a window size by using get statements.  As in:  Get ( WindowDesktopHeight ) - 1  or by script as in:

                  Move/Resize Window [ Current Window; Height: Get ( WindowDesktopHeight ) - 1; Width: Get ( WindowDesktopWidth ) -1; Top: 0; Left: 0 ]

                   

                  This would adjust a window to 1 pixel smaller then max in height and width and put it in the upper left corner.  If everything on the layout fit,  no scroll bars and to the average eye should look almost like a maxed window.  Opening another window would not resize this window.  You can put the get functions in the open window and GTRR window size fields so that it does this on window open.

                   

                  HTH

                  Bruce

                  • 6. Re: Modal Dialog Window Questions
                    jormond

                    I would love the ability to pop-up a lightbox or similar dialog window like you can do with java.  Hmmm, I wonder if you could to it using ScriptMaster.

                     

                    In the meantime, I have resorted to using a custom function that pings the size of the application window, then sizes the window to fit that.  Not maximized, but fits just inside that window.  And I hide the Status Area...and replicate the functions in a much smaller space.

                     

                    My users haven't really noticed that they are not maximized.  Unless they resized the app window manually.  Then I give them buttons that mimic the "maximize" function, and look like them, while hiding the original button in the windows.