Is it possible to make a FactoryPMI window modal? I am using a small window as a popup with further controls on it - for example when a user clicks on a tank, they are given the option to set the temperature up or down.
The problem I have is that the user can still interact with the parent window. Normally, clicking on the parent window will hide the popup window, even though it is still open. Making the popup window modal would stop any further interaction until the popup was closed.
To prevent the window from disappearing, you can set the layer of the popup window to a value greater than the background window. This will prevent it from disappearing when you click the window behind it
Thanks for your help. I was speaking to Travis about another point when I mentioned your idea. He came back with a development to stop access to any controls on the background window while the popup is open.
Develop your popup as a maximised window, with all controls in a container with a coloured background.
Put the following script in the window’s internalFrameActivated event:
window = fpmi.gui.getParentWindow(event)
window.setOpaque(0)
3. Set the layer of the popup window to a value greater than the background window.
Now when the popup is displayed, you can still see the background window , but you cannot click on any of its controls.
Thank you for posting this solution. I also had a similar need for a popup to always be on top. This method worked for me, after a little tweaking for my application.
I am developing a system which implements modal ‘popups’ using the technique I previously mentioned in this thread. However, I am now using an interface with a navigation bar docked north, with the main window filling the rest of the screen.
When I open the popup, it only covers the main part of the window, meaning that the user can still press buttons on the buttonbar. Is there any way to force the popup to occupy the whole screen even if there are docked windows present? I tried changing the window layer, but without success.
No, floating windows cannot cover docked windows. You can close the docked window and open it when necessary or disable any components on the docked window.
I know this is a really old thread now, but if anyone else stumbles across it like I did looking for a solution, here’s what I did:
(WARNING: it’s a bit of a messy hack, but worked for me)