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

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

Recommended Posts

Posted

FM PRO 7:

Could someone please open up this file and let me know why the button is doing what it does. I have a button that is supposed to open a new window of a certain size, switch its layout, allow the user to select a few options and then you submit it. all the functions work and it opens the new window, but it automatically resizes the main window to the other size window as well. i want the main window to stay the same size. I do not want them all to resizew. please open the file and click the "send media kit" button and see for yourself.

thanks

fmpro7.zip

Posted

Sorry to be the one bringing the bad news but as it stands it cannot be avoided. If the main window is maximized then it will resize to whatever it was before you maximized it. There is no way round this but you can minimize the effect by having your main window as large as possible without being maximized. If you like your window to be maximized "most of the time" then start your script with an Adjust Window (Resize to fit) step. That takes your main window off maximized but leaves it filling the screen area

Posted

All is not lost, fishbone. Here's your file back. This is how it's usually handled as SlimJim mentioned but I don't use Adjust Window. Adjust Window (Resize to fit) step does not always work because it bases its size on the layout and NOT the screen. And if you don't have an object to the far right edge of layout (example), it will bring the window size down until it finds something.

Forums has hundreds of such posts - how to keep a window maximized when opening a second. Answer is, "You can't." So you work with the tools you have. You lose a bit of screen real estate but everyone gets used to it. I attached this window script to your Startup in File Preferences. :wink2:

LaRetta

AdRep_Copy.zip

Posted

One more little suggestion ...

Your popup window, if User clicks outside of it, will drop to the back. If they select the button again, it opens ANOTHER copy of the window. It's resource wasteful and can cause 'you can't modify this record because it's being modified in another window' stuff. Add this to the beginning of your Mail Media Kit script:

If [ Position ( WindowNames ; "Select Media Kit(s)" ; 1 ; 1 ) ]

Select Window [ Name: "Select Media Kit(s)" ]

Else

... your New Window Name line

End If

In this way, if the Media Kit window is open but out of sight, it will just bring it to the front. If not open, it will create it. These are simply generic ideas. There are advanced windowing techniques and the subject could write volumes. You can even track your window names (so you don't have to hardcode in the calc itself). Hardcoding means you'll have to remember not to change that window name or layout name. I've done that and wondered why my popup broke. I've moved to less task-intensive methods since. And sometimes I lock a window on top also. But I wanted to give you a base in which to work. I hope it's helpful ... :wink2:

LaRetta

Posted

fishbone,

Add this line to your Mail Media Kit script before you open the new window

Move/Resize Window[Current Window; Height: Get(WindowHeight); Width: Get(WindowWidth); Top: Get(WindowTop); Left: Get(WindowLeft)]

This "manually" sets the size of the current window before you open the new window.

Let me know if it works for you.

Mike

This topic is 6951 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.