OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: Jim Short on November 21, 2012, 05:36:59 AM

Title: ListView vs ListBox and OnselChanged
Post by: Jim Short on November 21, 2012, 05:36:59 AM
Quoting Fred Tomke: "The advantage of the grid (towards the listview) is that there is a OnSelChanged event to get known when you've changed the selection using the keyboard." How does one get the current item index from ListView highlighted item when scrolling up and down the list with arrow keys? OnSelChanged does this fine in a ListBox.

Jim
Title: Re: ListView vs ListBox and OnselChanged
Post by: Fred Tomke on November 21, 2012, 11:54:51 AM
Hi, Jim,
Unfortunately, there is no OnSelChanged in ListView. You can be sure: I miss it, too :)
I've posted some ideas about changes for selection in listviews here (http://sourceforge.net/tracker/?func=detail&aid=2654702&group_id=187950&atid=923366).

Regards, Fred
Title: Re: ListView vs ListBox and OnselChanged
Post by: Jim Short on November 22, 2012, 05:52:20 AM
Fred, Thanks for the link. Is this missing event a limitation of the arx implementing MFC ListView or Windows ListView.
Does key up / down provide a satisfactory means of navigating with the arrow keys?
Do you have an example?
Cheers,
Jim
Title: Re: ListView vs ListBox and OnselChanged
Post by: Fred Tomke on November 22, 2012, 10:30:51 AM
Hi, Jim, at the moment I have no sample, sorry. And it is not satisfiying at all: you must catch OnKeyUp because at the time of OnKeyDown the selection hasn't changed yet (in my experience). Maybe I'm not uptodate.
If I had the knowledge of C++, I would add the event. But I haven't. As a C# programmer I know there is a OnSelChanged event in a listview. But I don't know if the event is available in C++, too.

Regards, Fred