[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== close window button (OpenInsight Specific) ==== === At 04 JAN 2002 11:33:29PM Glenn Bryant wrote: === {{tag>"OpenInsight Specific"}} How can I disable the X at the top right of windows (next to the maximize button? I want to force the user to go thru my closing routine as the only way to leave a window. Thanks ---- === At 05 JAN 2002 12:08AM Mike Ruane wrote: === Glenn- Double-click on the window to see its properties. Un-check the 'System Menu' checkbox. Hope it helps- Mike ---- === At 05 JAN 2002 09:51AM Glenn Bryant wrote: === Mike, the 'System Menu' button being unclicked may disable the X while you're still in the form designer, but as soon as I execute the window the X is back and alive and well. Am I maybe doing something to cause it to reactivate? Thanks for the help ---- === At 05 JAN 2002 11:22AM Oystein Reigem wrote: === Glenn, As an alternative you could just keep the X button active but have a scripted CLOSE handler that kept the window from closing, by doing a Return 0. The handler could also issue an explanatory message - tell the user what she had to do to get the window to quit. But having said that - Mike's suggestion works here, with 3.61 on XP. - Oystein - ---- === At 05 JAN 2002 11:29AM Glenn Bryant wrote: === Thanks, Oystein. I just tried your suggestion, having simply a script of RETURN 0 on the close event of the form, and I think it may solve my problems. In spite of the system menu setting, the X is still active, but when I click on it it just ignores me. Happy days. I will follow up on displaying a message to the user, but I think this takes care of my needs. BTW, I'm running 3.7.2 on both Win98 and WinME and have identical reactions on both. ---- === At 05 JAN 2002 11:52AM Glenn Bryant wrote: === Scratch the 'Happy Days' in the prior message. Once I put a 'return 0' on the close event of the window, I can no longer close it with my close action either, which is a 'send_event' with CLOSE as the parameter. So how do I get around this catch-22 situation? Is there some way I can dynamically alter the script when I want to close the screen? ---- === At 05 JAN 2002 12:01PM Oystein Reigem wrote: === Glenn, So you did need the CLOSE event for other stuff (see my reply on the other list). Of course. The CLOSE event has a flag. Use that flag when you send the CLOSE event - when you mean to close for real. Let the CLOSE handler check the flag and do a Return 1 if the flag is set, else do a Return 0. - Oystein - ---- === At 05 JAN 2002 12:06PM Oystein Reigem wrote: === Glenn, ...something like this: The handler where you want to close for real: Stat=Send_Event( @Window, "CLOSE", 1 ) The CLOSE handler: if CancelFlag then RETURN 0 end else RETURN 1 end - Oystein - ---- === At 05 JAN 2002 12:11PM Oystein Reigem wrote: === Glenn, Sorry - it should be the opposite: The handler where you want to close for real: Stat=Send_Event( @Window, "CLOSE", 1 ) The CLOSE handler: if CancelFlag then RETURN 1 /* go ahead and close window */ end else RETURN 0 /* stop processing; window will not be closed */ end What confused me is the name of the flag parameter. The docs call it the "cancelflag". It should rather be called "notcancelflag" or "notcancelCLOSEflag" or "doCLOSEflag". - Oystein - ---- === At 05 JAN 2002 12:44PM Glenn Bryant wrote: === Oystein, thanks for that explanation - thats how I'll do it since it seems more in keeping with the overall structure. In the intervening time, I had figured out that I could just set a parameter in the MISC property of the window and accomplish the same thing, but I like your way better. Thanks again. ---- === At 05 JAN 2002 12:51PM Oystein Reigem wrote: === You're welcome. Now if you could only pop over here and help me with some housework. :-) - O - [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=BD0BD5DD1D30F46C88256B38001909EA|View this thread on the forum...]]