Listview OnClickEvent issue

Started by Danner, January 10, 2008, 04:35:18 AM

Previous topic - Next topic

Danner

Hi

When I use an OnClick event with the ListView (on a docked/modeless form), to activate a lisp routine which involves selecting an entity in the drawing eg ((setq SSet (ssget)) -

All works fine except it is necessary to click the drawing space to activate the curser to allow the items to be selected in the space.  Although minor, rather annoying.  This doesnot occur if the same function is activated by a button.

I was wondering if this is a glitch or if there is a workaround or indeed I've missed something obvious (I am fairly new to this)?

Thanks in anticipation and thanks for this brilliant tool.

Dan

Danner

I've worked around this by setting the listview visibility to false then true prior to implementing my lisp routine within the onclick event.

More elegant solutions gratefully received.

Dan

BazzaCAD

Hi Dan,
Welcome to the team.

Put (dcl_SetCmdBarFocus) in your OnClick event before your (SSGET)
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Danner

Thats done it!
Many thanks Barry.

owenwengerd

Quote from: DanW on January 10, 2008, 04:35:18 AM
I was wondering if this is a glitch or if there is a workaround or indeed I've missed something obvious (I am fairly new to this)?

Dan, just to tie up the loose end, it's like this by design.  Any controls on your dockable form that can accept keyboard input will capture the mouse and keyboard so that AutoCAD doesn't steal input focus when the cursor moves off the form. There are some undesirable side effects as you've found, but there are workarounds, and in any case the alternative is worse. :)
Owen Wengerd (Outside The Box) / ManuSoft