yield() (OpenInsight Specific)
At 17 FEB 1998 05:56:05AM Jacob Ignatius wrote:
The subroutine yield() checks for pending events in the Windows event queue and executes them. I have a case where I create a window setting it to be application modal in a subroutine and wait for that window to be closed. yield() does not wait for pending events from the window that is opened manually. It only seems to work for the window on which the new window is opened upon.
yield() seems to be the only way for allowing of waiting for a window event. It would be good if could have a command such as
new_window.yield()
where new_window is the window I open manually. Obviously I can't and at the moment the yield() waits for input from the original window. I have a "close" button on new_window that closes it.
Is there any way of detecting the closure of new_window?
At 17 FEB 1998 07:35AM Cameron Revelation wrote:
Jacob,
Can you explain what you are trying to accomplish? It sounds like you want Dialog_Box, which launches a modal (both in terms of UI and processing) window which does not return (from the Dialog_Box call) until the window closes.
Cameron Purdy
info@revelation.com
At 17 FEB 1998 09:06AM Jacob Ignatius wrote:
Cameron, you're probably right. I wasn't aware of the dialog_box function. My code is shown below :
window=LO_FEE_SELECT"
r=start_window(window,@window,"",1,"")
r=580 ;* MDIClientSizeSmall
r=320 ;* MDIClientSizeSmall
r=0 ;* (ScreenSize - r)/2
r=0 ;* (ScreenSize - r)/2
s=utility("CREATE",r)
s=set_property(window:".BADGER_ID","TEXT",badger_id)
s=set_property(window:".MEMBER_NO","TEXT",member_no)
r=1
r=window
s=set_property("SYSTEM","MODAL",r)
s=send_event(window,"CREATE",9999)
Process=lo_fees_select"
loop while Process=lo_fees_select"
yield()repeat
By setting r, r, r and r I am able to set the size and location of the window. Could I do this using dialog_box?
At 17 FEB 1998 09:08AM Aaron Kaplan wrote:
There some examples of this in the AUTOMATED_BANKING program. In my copy it starts at about line 226 and finishes though that else clause. In case your copy has been changed, it's in the
elsebranch of the
if flag=QUIET"...segment.
If this is what you are trying to duplicate, then this should be a dialog box. The AUTOMATED_PAYMENT should be a dialog box. Almost all of the modal windows should be dialog boxes as well.
I've threatened to go through the whole system and change all these things since they once caused me a mess of trouble.
As for the yield. since there is a modal window, I would guess that the only event yield would process would be from the modal window. I would expect that you would not receive events since the events cannot be processed.
Either way, we can argue the finer points of this later.
apk@sprezzatura.com
At 17 FEB 1998 09:23AM Aaron Kaplan wrote:
Jacob,
Yes. Look in the on-line help for the size property. You'd set the size on the create event. If you set the window as invisible from the form designer, setting the size will make it appear in the correct place without flickering.
Dialog boxes also position themselves overlapping the parent window. By using MAIN as the parent instead of one of the children, you should eliminate some of the sizing dynamics.
Just for your reference, MDIClientSizeLarge and MDIClientSizeSmall are in the MAIN insert and defined as part of the MAIN_1 labelled common block. It might be a good idea to use that, especialy if the plan to increase window size goes through. You'd hate to have this hard coded, wouldn't you?
apk@sprezzatura.com