Author Topic: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding  (Read 2780 times)

0 Members and 1 Guest are viewing this topic.

Lube

  • Guest
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

owenwengerd

  • Bull Frog
  • Posts: 439
Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
« Reply #1 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.

Lube

  • Guest
Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
« Reply #2 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

owenwengerd

  • Bull Frog
  • Posts: 439
Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
« Reply #3 on: April 15, 2015, 09:45:47 AM »
This is answered in the event documentation.

Lube

  • Guest
Re: OPENDCL - avoid exit modeless dialogs if [enter] key is presseding
« Reply #4 on: April 16, 2015, 09:19:07 AM »
Thanks :)