I think I saw a thread on this, but I can not seem to find it right now. What I am trying to do is when a event happens in a parent window (ie.. a field value changes), I want to notify all the children window about that event and have them react to the new field value. Normally I would have the parent procedure publish an event and have the child subscribe to it, but the rules for publish and subscribe with classes seems to be different. So can anyone point me to the best way to handle this, keeping in mind that the child windows can be opened or closed by the user?
Thank you
Okay, I have found out how to execute methods in child windows, when a event in the parent was triggered. The code was basically in the close window method of the standard mdi window. Now the second half of my question. How can I determine if a child window is already open? I want to know this because I only want to open one copy of each window. Thank you.
Okay, I have found out how to execute methods in
child windows, when a event in the parent was
triggered. The code was basically in the close
window method of the standard mdi window. Now the
second half of my question. How can I determine if a
child window is already open? I want to know this
because I only want to open one copy of each window.
Thank you.
You can check/traverse the MDI parent form's MdiChildren property to see all of the MDI children, or you can use something like a temp-table and check whether a child form has already been invoked.
AutoEdge uses the latter approach. If you do this, remember to clean up when the child form is closed (take a look in gui/autoedge/mainviewaui.p for both of these).
-- peter
Where can I find gui/autoedge/mainviewaui.p?
Message was edited by:
Frederic Boisseau
Never mind I found it.
AutoEdge is available here http://www.psdn.com/library/entry.jspa?externalID=5742&categoryID=2064 . You'll need to install it to look at the source code.
-- peter
Isn't there a more elegant way of communicating between windows than placing code in the close window method. Publish and Subscribe was pretty powerful and very elegant. Don't we have equivalent in OO approach ?