Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

What does Resize to Fit really do?


This topic is 3592 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm confused about the meaning of the script step Adjust Window [Resize to fit]. The official Filemaker definition is that it "resizes the window to the minimum size possible while keeping all items in the layout visible."

I have many layouts that each show a different portal, and I have a button for each such layout that opens a window with the layout in it. I'd like the window to have no unnecessary space around the portal. Right now I keep global variables for the width and height of each layout (adding in a buffer below the portal and to the right). When the button is clicked, the window is sized according to the global variables. However, whenever I change the layout I must experiment until I have just the right size for the window, and then I must manually change the global variable. How much easier it would be to have a script step that did all that for me! But this is exactly what the definition of "Resize to fit" seems to promise, except that it isn't what happens, and respondents on the Forum seem to be saying that "Resize to fit" doesn't actually do what the definition says it does (without quite putting it that explicitly).

Should I simply give up on finding an automatic procedure for opening windows with the right dimensions? Perhaps I have been misinterpreting the definition of "Resize to fit."

Posted

Draw a rectangle on the layout that encloses all the other objects such as the portal. When the window is re-sized it will shrink (or expand) to fit this rectangle. The rectangle can (should) be set to auto-size as the window changes: this does not change the effect of the re-size command since it shrinks the window to the minimum size of the objects.

I'm not sure why you need to keep track of layout size in global variables. Not only is in not necessary, it won't be cross-platform compatible because window sizes are slightly different between Mac and PC.

I define a rectangle for the layout size at the start of the design process and make sure each layout sticks with it. If I need to change one layout then I go back and change them all -- not a minor undertaking so there is time expended to get it right the first time. This creates a very consistent illusion of smoothness in navigation for the user.

  • Like 1
Posted

"minimum size possible while keeping all items in the layout visible" means minimum - i.e. no "buffer" below and to the right.

You can use the Get (WindowHeight) and Get (WindowWidth) functions to set your variables. Or use them in your current script to add margins, after calling Adjust Window [Resize to fit].

Posted

Thanks! I was having trouble getting things to work previously because I unthinkingly added the Adjust Window step after the Open Window step, rather than after the subsequent Go to Layout step. In any case, the rectangle idea works beautifully.

  • 2 months later...
Posted

There is a gotcha: in list view the resize to fit command sets the window WIDTH to the minimum horizontal size, but the HEIGHT of the window is changed to fill the vertical space of the desktop. This is different from what happens in form view.

I set the window in a "blank" layout in form view (with the previously mentioned rectangle on it) and then change to the list view.

  • 4 years later...
Posted

Which is precisely my problem: the page expands to the size of my monitor in list view, making the resize control useless.

Posted

Well. Making the resize control not do what you want it to do until you tell it what you want it to do.

You can set window height.

This topic is 3592 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.