1. Kyle Griffis
  2. PowerBuilder
  3. Thursday, 17 January 2019 20:52 PM UTC

Hello everyone,

Our end users use two monitors and they open two copies of the same application which they slide one copy over to their second monitor.  When the system opens a dialog it always opens up on the primary monitor not the one that it's frame window is actually displayed on.   Anyone have a work around for this behaviour?

As always, thank you for your time.

Kyle

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 18 January 2019 16:07 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Kyle;

   Yes, this is something that the PB run-time does not account for, in more ways than one. My STD integrated framework has been handling this for many years. What I never thought about was two or more instances of one App across dual monitors, so I just tested that a few minutes ago and it works "like a charm" ...

 

     I just added some new code to the framework last weekend to enhance the centering of Response and Pop-up windows even more as well as automatically restoring the App and the previous dialogues on a shutdown / start or Restart() command. The code even works well in a PowerServer Web app as well. It always centers the dialogues where the host web browser is located. So running this test on dual Web Apps worked 100% as well.  In my Web test App, I even tried moving the browser while the App was opening & closing various response / popup windows at the start-up. It was very "kool" to see those dialogues follow the browser App / monitor location auto--magically!  ;-)

   You can test out the improvements in the example OrderEntry App for either PB2017R3 or PB2019 Beta#1 by downloading the beta of the OE test App that uses the STD framework from here:  https://sourceforge.net/projects/stdfndclass/files/Applications/PowerBuilder/OrderEntry/Beta

   My plan is to release production version of the new (updated) framework version to closely coincide with the PB2017R3 MR01 release coming in a few weeks.

  The only thing I need to do now is tie-in the framework to IWA based Apps as these type of Apps seem to need the same help in this area as well. IWA apps do not seem to understand how to center on a single monitor for example. I never thought about multiple instances of an IWA App. Hmm .. stay tuned after I work on this over the weekend.  :-)

    So .... to answer your question, please feel free to use the framework or borrow the code to make this happen in your App(s). Feel free to contact me if your interested in locating the code or understanding the approaches I use. I can then point you to the code segments that you can use / rework for this purpose to copy over to your App.

PS: This multiple instance feature of the framework also works on PS Mobile apps where on an Android device, you can run "split screen". "Kool" or what - LOL!

HTH

Regards ... Chris

 

 

 

 

 

 

Comment
  1. Kyle Griffis
  2. Tuesday, 22 January 2019 14:57 PM UTC
Hi Chris,



I was showing my Dept Manager some of the behaviour and he noticed something that I became immune too while testing ... whatever monitor was the last monitor to have an application window (did not matter what type of window) displayed was the monitor the messageBox would display. Seeing how we use the PFC I placed the code I copied below in the base classes where the system function messageBox is called and it seems to do the trick. The con to this approach is if there is code in the Frame window's activate event, it could cause unexpected behaviours. Luckily the PFC frame window has harmless code in it so no harm in our particular circumstance. So kudos to the Dept Manager!



w_frame iw_frame

iw_frame = gnv_App.of_getframe( )

If IsValid(iw_frame) THEN iw_frame.event activate( )



Thank you Chris for responding, it's highly appreciated!

  1. Helpful
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Friday, 18 January 2019 14:22 PM UTC
  2. PowerBuilder
  3. # 1

Kyle,

We need some more information to try to figure out what's up with your dialogs.

What version of PB is this?

Are the dialog boxes from messagebox, or from response windows in your app?

If they're response windows, is there any code to do centering or other position manipulation?


I just tried out one of our apps (in PB2017r1), and it's messagebox popups follow the proper monitor (I have 4, and if I put the app on any one of them, messagebox pops up on that monitor). I do remember older versions of PB not using the matching monitor, so knowing version of PB you're using will help.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.