"X" button in top right

Started by Syncmas, November 06, 2013, 01:48:21 PM

Previous topic - Next topic

Syncmas

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


owenwengerd

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 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.

Syncmas

Is it possible to handle the close event on a form that does not have a CancelClose event?

owenwengerd

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.