TheSwamp

Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: Lube on April 14, 2015, 11:34:05 AM

Title: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
Post by: Lube on April 14, 2015, 11:34:05 AM
Hi there!

I was looking for a way to avoid exiting modeless dialogs in autocad (created by opendcl) when [ENTER] is pressed.

Does someone know?

Thanks, Dennis
Title: Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
Post by: owenwengerd on April 15, 2015, 02:29:42 AM
You have to handle the OnCancelClose event and respond accordingly depending on whether to cancel or allow the event to proceed. Take a look at the Events sample (use the OPENDCLDEMO command to run samples quickly). There are also many examples of this in the OpenDCL forum.
Title: Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
Post by: Lube on April 15, 2015, 05:20:04 AM
Thanks Oven, I didn't notice it :)

Code: [Select]
(defun c:cordoli/cordoli#OnCancelClose (Reason /)
  (dcl-MessageBox "Use TAB key")
)

Any way to do nothing without show messageBox? I tried with a (princ) but the dialog closes.

The better thing will be having the same behaviour of the TAB key.

Thanks :)
Dennis
Title: Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
Post by: owenwengerd on April 15, 2015, 09:45:47 AM
This is answered in the event documentation (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/CancelClose.htm).
Title: Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
Post by: Lube on April 16, 2015, 09:19:07 AM
Thanks :)