OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: Syncmas on November 06, 2013, 01:48:21 PM

Title: "X" button in top right
Post by: Syncmas on November 06, 2013, 01:48:21 PM
Is there any way to prevent the "X" in the title bar from showing up in dialogs?

I have a couple of old commands that were converted over to OpenDCL and they open settings dialogs, and prompt a user to select an object. If the user hits enter or esc everything is handled and terminates properly. If the user presses that "X", the dialog closes and I am still waiting for an object selection. The type of dialog is a control panel and maybe it needs to be shifted to another type. I am a OpenDCL and lisp rookie so maybe there is a simple way of doing it that I have just not found yet.
Any tips would be appreciated.

Thanks
  Scott

Title: Re: "X" button in top right
Post by: owenwengerd on November 06, 2013, 02:13:23 PM
There isn't any way to remove the "X". If I understand correctly, the user presses a button, which starts a command at the command line, and you want to make sure that if the user closes the control bar, the command is cancelled. You should be able to do this fairly easily.

The first part of the solution is to track when your command is active. I would probably do that by disabling the button that activated it, then re-enabling the button when the command finishes.

The second part of the solution is to handle the form's OnClose (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/Close.htm) event, and in there check whether your command is active (e.g. by checking whether the button is disabled), and if it is cancel it.
Title: Re: "X" button in top right
Post by: Syncmas on November 06, 2013, 02:40:21 PM
Is it possible to handle the close event on a form that does not have a CancelClose event?
Title: Re: "X" button in top right
Post by: owenwengerd on November 06, 2013, 05:58:14 PM
Quote from: Syncmas on November 06, 2013, 02:40:21 PM
Is it possible to handle the close event on a form that does not have a CancelClose event?

Yes, it should be.