Author Topic: ListView vs ListBox and OnselChanged  (Read 1221 times)

Jim Short

  • Full Member
  • ***
  • Posts: 170
    • Tahl Inc
ListView vs ListBox and OnselChanged
« on: November 21, 2012, 06: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
Jim Short

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1810
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: ListView vs ListBox and OnselChanged
« Reply #1 on: November 21, 2012, 12:54:51 PM »
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.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Jim Short

  • Full Member
  • ***
  • Posts: 170
    • Tahl Inc
Re: ListView vs ListBox and OnselChanged
« Reply #2 on: November 22, 2012, 06: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
Jim Short

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1810
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: ListView vs ListBox and OnselChanged
« Reply #3 on: November 22, 2012, 11: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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]