OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: khann on September 20, 2009, 06:03:00 PM

Title: Selection Count in ListView
Post by: khann on September 20, 2009, 06:03:00 PM
Hi.
I need some sample code of labeling of selection count in ListView control.
One ListView and one Lable.
I've tried with OnMouseUp event, Click, OnMouseDown, ... but they do not return the count right after the left mouse button.

Someone guide me, please.

I'm using 5.1.1.8 msi.

Thanks.
Title: Re: Selection Count in ListView
Post by: owenwengerd on September 20, 2009, 10:33:46 PM
Since there is no OnSelChanged event for list view controls, you may need to call (dcl_SendString) or (dcl_DelayedInvoke) from your OnClicked handler to trigger your label update function. By doing this, the list view selection state will have updated by the time your label update function executes.
Title: Re: Selection Count in ListView
Post by: Fred Tomke on September 21, 2009, 12:28:17 AM
Hello Owen, how hard would it be to add an OnSelChaged event for a listview or would it brake the standard behaviour of the built-in listview? ListBox, Grid and FileExplorer support such an event. I remember a feature request (https://sourceforge.net/tracker/?func=detail&aid=2654702&group_id=187950&atid=923366) (Point 4) which already contained this.

Fred
Title: Re: Selection Count in ListView
Post by: owenwengerd on September 21, 2009, 01:03:35 AM
There is no corresponding Windows event for the list view control, but a SelChanged event could be manufactured (just as in the grid control).
Title: Re: Selection Count in ListView
Post by: khann on September 21, 2009, 05:30:44 PM
Thanks for the tip. owenwengerd .
I'll test them.