DCL - How to make [return] key work?

DCL - How to make [return] key work?

Anonymous
Not applicable
409 Views
3 Replies
Message 1 of 4

DCL - How to make [return] key work?

Anonymous
Not applicable
Hi,

in my custom dcl-driven dialogs, how can I make the [return] key work? I'm using ObjectArx 2005.

More specifically, I've got an edit box, where the user can input something and needs to issue the action by clicking on a button. This is quite uncomfortable, since most people will try to press the [return] key to commence the action. Unfortunately this doesn't work, since the focus is still on the edit box. (It is possible to press [tab] and then [return], but this also isn't very nice...)

Is there a way to "connect" the [return] key to a specific button, when pressed inside an edit box?

This issue is bugging me for a long time, so I would be very glad if someone had any idea on this.

(Yes, I know, don't use dcl dialogs, but well, I like them 😉

Thanks,
Sebastian
0 Likes
410 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Sebastian

I think that the allow_accept = true; attribute added to the edit box def in
the dcl file might do it, when the edit box has focus

Laurence

wrote in message news:4842561@discussion.autodesk.com...
Hi,

in my custom dcl-driven dialogs, how can I make the [return] key work? I'm
using ObjectArx 2005.

More specifically, I've got an edit box, where the user can input something
and needs to issue the action by clicking on a button. This is quite
uncomfortable, since most people will try to press the [return] key to
commence the action. Unfortunately this doesn't work, since the focus is
still on the edit box. (It is possible to press [tab] and then [return], but
this also isn't very nice...)

Is there a way to "connect" the [return] key to a specific button, when
pressed inside an edit box?

This issue is bugging me for a long time, so I would be very glad if someone
had any idea on this.

(Yes, I know, don't use dcl dialogs, but well, I like them 😉

Thanks,
Sebastian
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks Laurence,

this works! Wonder why I never stumbled over this attribute when reading the docs...

There's a big caveat however. Only one button (the one where is_default = true) can be "connected" to the [return] key. What if I had multiple edit boxes with multiple corresponding buttons? I havn't however 🙂
0 Likes
Message 4 of 4

Anonymous
Not applicable
I use DCL Code Generator v2 to build DCL files, it is much quicker and shows
all the attributes, might be worth a look if you are going to use DCL files.

The allow_accept on edit boxes just fires the action tile "accept" or
whatever key you use for the default button, so yes you can only connect one
function to the action. I must say I only use DCL when using lisp, I use MFC
Dialogs when using ARX.

Laurence

wrote in message news:4843957@discussion.autodesk.com...
Thanks Laurence,

this works! Wonder why I never stumbled over this attribute when reading the
docs...

There's a big caveat however. Only one button (the one where is_default =
true) can be "connected" to the [return] key. What if I had multiple edit
boxes with multiple corresponding buttons? I havn't however 🙂
0 Likes