Started by Jürg Menzi ·
2010-06-10 07:00 UTC ·
4 replies · SMF topic #1291
Jürg Menzi
2010-06-10 07:00 UTC
Hi all
Probably I've a hole in my brain... ;D
but how to close a modeless dialogue by ESC key if the dialogue has no focus?
Cheers
owenwengerd
2010-06-11 02:23 UTC
The window with keybard input focus decides how to respond to the key. If that window is the AutoCAD command line, there are probably ways to translate into a (dcl_Form_Close) call, but offhand I don't know what would be the best way to do that.
Jürg Menzi
2010-06-11 07:58 UTC
Hi Owen
Thanks for the answer - seems to be a disadvantage of modeless dialogues.
Meanwhile I use a (partial) solution with a command reactor. If the user invokes an unused command (he needs only Zoom, Pan etc. during the modeless dialogue), the dialogue will be closed by this reactor - not perfect but usable.
It would be fine if AutoCAD would offer something like a KeyPressed reactor... 8)
Cheers
jmaeding
2010-06-14 18:07 UTC
it seems like you would only want a modeless to close when doing something involving it.
If you draw a line, and hit escape, you do not want some dialog to close.
If you are running a command like "change color", and you has a modeless dialog with colors, then you could program in code to close that dialog if the user hits escape during the command.
I'm a bit surprised you want to close dialogs outside of commands that involve them.
maybe you want to close them during things like zoom and pan, but that will be very annoying to people suring the commands that do need them.
Can you explain a bit more what you are doing?
Jürg Menzi
2010-06-15 13:29 UTC
Hi James
The only thing to use a modeless dialogue was to allow the user using zoom, pan, etc. during the dialogue. The first idea was to close the dialogue by ESC key, but no solution available. This was the reason to use a command reactor for close the dialogue if the user starts another command than zoom, pan, etc.
Cheers