Customizing Form Window Initial Position, Size and Title

I don’t usually pre-announce new features, but since this feature was based on a discussion here over the weekend, I’m going to explain this new feature now even though it’s not yet available.

In the upcoming b34 version there are two new form events, formRECTANGLE: and formWINDOWTITLE:. These allow you to write code to customize the position, size and title of a form window as it is opened. For example, you could automatically center the window on the main monitor, no matter what the monitor size is. This works no matter how the form is opened – if it opens when the database is opened, from the view menu, etc. However, you can override this customization with the openform statement.

If you are interested in the details, the documentation is already available, with some examples:

This was based on a question from Paul Chance. Paul actually wanted more than this, he wanted all of the options available in the openform statement. However, I’m not going to go any farther than what I’ve done already – the window title customization took much longer than I expected it would.

I actually think this feature is pretty nice and I hope Paul isn’t the only one that uses it.

I certainly will. I have been using less reliable methods!

New documentation says: “each form window is titled with the database and form name, separated by a comma”. You meant “colon.”

Thank you Jim! I figured when a file is open, it can query the size of the primary monitor (sometimes there’s more than one monitor) and place itself anywhere within (or without) those coordinates. The way it works now, even if I’m using a secondary extension monitor, PanX doesn’t consider that in the calculation - which is good. It’s centered on the primary monitor. If it used the “full length”, adding the space of a second or third monitor, the “center” could be between the two.

Thanks, I got two reports of that. It’s fixed now.

I don’t know if you read the documentation I posted but it has two examples of how to do exactly that.

At this time Panorama has no way to access the dimensions of monitors beyond the primary monitor.

I’m sorry Jim, I didn’t realize the “Newly Opened Database Window Arrangement” was live. I’ll read it now.

Showing my ignorance here but a stumble I keep making was using Window Dimensions to get the pixel size of the window while it was still in graphics mode. I’m designing/sizing it for objects and still in graphics mode when I want to set the size. I tried clicking on the upper left-hand corner of the rulers because in some application (maybe old Panorama, maybe not), that would change the coordinates from inches to pixels. As all the window/form parameters use pixels, it’s handy to have both.

But now I know I can just put the window in data mode and use Window Dimensions from that state.