OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Danner on January 10, 2008, 04:35:18 AM

Title: Listview OnClickEvent issue
Post by: Danner on January 10, 2008, 04:35:18 AM
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
Title: Re: Listview OnClickEvent issue
Post by: Danner on January 10, 2008, 06:01:00 AM
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
Title: Re: Listview OnClickEvent issue
Post by: BazzaCAD on January 10, 2008, 10:28:20 AM
Hi Dan,
Welcome to the team.

Put (dcl_SetCmdBarFocus) in your OnClick event before your (SSGET)
Title: Re: Listview OnClickEvent issue
Post by: Danner on January 11, 2008, 12:40:11 AM
Thats done it!
Many thanks Barry.
Title: Re: Listview OnClickEvent issue
Post by: owenwengerd on January 16, 2008, 09:34:00 PM
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. :)