1. Yiannis Papadomichelakis
  2. PowerBuilder
  3. Friday, 7 February 2020 14:59 PM UTC

Hi PB people!

Since the docked interface is buggy and will not be supported in the next release, I am trying to implement my own “docked like” interface. I created a visual uo that has buttons for each mdi sheet.

Opening the sheets is performed through a controller object, so creating the buttons is easy, no modifications needed.

My problems begin when changing focus, changing titles and closing windows. If this was a new app, I would make all mdi sheets to notify this controller when receiving focus, changing sheet titles or closing, but here we are taking about 20yo app with hundreds of windows.

One idea is to use a timer event and check the state of all mdi windows, but I really would like to avoid that.

Is there a way to capture the sheets activate event and title changed / closed on the MDI window?

 

Accepted Answer
Brad Wery Accepted Answer Pending Moderation
  1. Friday, 7 February 2020 19:23 PM UTC
  2. PowerBuilder
  3. # Permalink

The best approach would probably be to give all your sheets a common ancestor. Even with hundreds of window objects, this wouldn't be difficult (just very boring for a couple hours). Once you have the common ancestor, you can put all your sheet management logic in there.

 

Comment
There are no comments made yet.
Andrew Barnes Accepted Answer Pending Moderation
  1. Friday, 7 February 2020 17:27 PM UTC
  2. PowerBuilder
  3. # 1

I know what you mean about 20 year old applications with hundreds of windows.  We have a few of those apps in our shop as well.

I am guessing that your mdi sheets are not derived from a common ancestor.  If so, my suspicion is that you will end up having to touch each of your sheet windows.  I would think that the easiest way to be to create an mdi sheet base class window.  You could then code all the interaction with the frame window and controller object into this mdi base sheet window and your mdi sheets inherited from it will just work without additional programming.

Of course, you would have to then change the inheritance of each of your mdi sheets to inherit from the mdi base class, but at least simply changing the inheritance is literally changing just two lines of code, both of which are right at the top of the code when editing the window in source code mode, so it is more of the mindless assembly line programming that can be accomplished fairly quickly with minimal chance of inserting a bug.

Comment
  1. Yiannis Papadomichelakis
  2. Friday, 7 February 2020 18:09 PM UTC
Yes.... I am afraid that I wont avoid this.... :(
  1. Helpful
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.