Jump to content
Server Maintenance This Week. ×

FM12 - Floating document window issue


AdrianDC

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

Recommended Posts

  • Newbies

Hi

I'm trying to create a "pop-up window" so users can select items from and return to the main layout. I also want to save the window location for user convenience, so the next time the selection window is called it'll show up at the same location as when it was closed.

I set up a button to call the script that brings the window up and two global fields to capture the window's location when it's closed. Everything is working. The problem I'm having is when the main file is opened.

My startup script is simple:

-Go to the main layout

-If guest account hide toolbars

-Resize window to fit

The floating window script:

-New window called "Item Selection" position based on global fields

-Go to item selection layout

-Hide toolbars

-Resize to fit

Script trigger: On layout exit

-set the global field window top and left

The issue is that if I use the floating document window, close it, and then close the main file; when I reopen the main file, the main window opens where the floating window was and not where the main layout window was and I need it to start up where main layout window was, not the floating window position. This does not happen if I disable the script steps to save the floating window location.

Hope that makes sense.

Am I missing something? Do I need to add another script step or is this a bug?

Any help appreciated.

Link to comment
Share on other sites

<strong class='bbc'>Automatic message</strong><br /> <br /> <br />This topic has been moved from "<a href='http://fmforums.com/...layer/&#39;>The Presentation Layer</a> → <a href='http://fmforums.com/...9;>Layouts</a>" to "<a href='http://fmforums.com/...layer/&#39;>The Presentation Layer</a> → <a href='http://fmforums.com/...12/&#39;>Custom Themes in FM12</a>".

Link to comment
Share on other sites

  • Newbies

Not sure if this is the right forum to post this question (apologies if not).

FM 12 doesn't seem to be saving layout window's state (location, size, toolbar state, etc) when you close the file. I noticed that FM is only "remembering" the window state if I make a layout change and save it, then go back to browse mode and close the file.

This is particularly bad if I have scripts that open new windows. Which is causing the issue described in the post:

http://fmforums.com/...t-window-issue/

Is this a known bug? Anyone else experiencing it? Or is this "expected behaviour"?

Link to comment
Share on other sites

  • Newbies

have you tried using a move/resize window script step?

I can add the move/resize window script to the startup script in order to force the window back to where it's supposed to be. But the problem is that this is affecting multiple files/solutions and the state of several files are not being saved (not just window positions). For example, if I open a file, sort records then go to first record. If I close that file, when it's reopened the file is no longer sorted as per before being closed.

I'm starting to think this is a bug. I can't think of anything of why the file is permanently locked on a specific state.

Link to comment
Share on other sites

  • Newbies

My startup script is simple:

-Go to the main layout

-If guest account hide toolbars

-Resize window to fit

The floating window script:

-New window called "Item Selection" position based on global fields

-Go to item selection layout

-Hide toolbars

-Resize to fit

Script trigger: On layout exit

-set the global field window top and left

The issue is that if I use the floating document window, close it, and then close the main file; when I reopen the main file, the main window opens where the floating window was and not where the main layout window was and I need it to start up where main layout window was, not the floating window position. This does not happen if I disable the script steps to save the floating window location.

Hi Adrian,

I'm not an expert but I did a test which seems to work.

Regarding your script trigger I guess you don't use the same layout for both your windows. In that case the exit of the main window layout script will overwrite the data of the floating window.

In my test I named my floating window, and I scripted the exit trigger to save only my floating windows' data.

Also I stored the data in global fields.

So it works after either the exit of the floating window or the reopen of my database.

Hope it helps, else ask me for more info.

br

Link to comment
Share on other sites

  • Newbies

In my test I named my floating window, and I scripted the exit trigger to save only my floating windows' data.

Hi, br

My layout exit script is based on the floating window layout. Here are the actual scripts:

From the main layout, you click a button that activates the Item Selection script that creates a new window and positions it based on global fields...

Freeze Window

New Window [ Name: "Item Selection"; Height: 433; Width: 439; Top: Price Checker::zz_Item Selection WinTop; Left: Price Checker::zz_Item Selection WinLeft; Style: Floating Document; Close: “Yes”; Minimize: “No”; Maximize: “Yes”; Zoom Control Area: “No”; Resize: “Yes” ]

Go to Layout [ “Item Selection” (Price Checker) ]

Show/Hide Toolbars [ Lock; Hide ]

Adjust Window [ Resize to Fit ]

The Item Selection layout is the one with the script tigger on LayoutExit that sets the global fields with the window's position...

Set Field [ Price Checker::zz_Item Selection WinLeft; Get ( WindowLeft ) ]

Set Field [ Price Checker::zz_Item Selection WinTop; Get ( WindowTop ) ]

Close Window [ Name: "Item Selection" ]

My startup script doesn't call the values from the global fields holding the item selection window position...

If [ Get ( AccountName ) = "Guest" ]

Show/Hide Toolbars [ Hide ]

Else

Show/Hide Toolbars [ Show ]

End If

Adjust Window [ Resize to Fit ]

I would be interested in knowing how you did it (are you using 12.0v3?). I'm not quite sure how closing the Item Selection window is overriding the main window's position since the global field is not used for the main window, and the main window is closed after the item selection window.

All of this also doesn't explain why FM is not saving the state of files (window size, position, sort, last active record) when they are closed (as mentioned above).

Link to comment
Share on other sites

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