I need how to get the selected item index in wxListCtrl.
I need it for the wxListCtrl->GetItem(). I need to know which row in
wxListCtrl is selected. In wxListBox was really nice function
GetSelection(), but it is not for wxListCtrl. I have found a solution
for wxpython, but not for C++ :-(
Jan
long item = -1;
for ( ;; )
{
item = listctrl->GetNextItem(item,
wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED); // use
wxLIST_STATE_DONTCARE for all items
if ( item == -1 )
break;
// this item is selected - do whatever is needed with it
// use listctrl->GetItemData(item) to get data
wxLogMessage("Item %ld is selected."), item);
}
Jan Polzer wrote:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
> For additional commands, e-mail: wx-use...@lists.wxwidgets.org
>
>
>
--
Jorg's wxWidgets Page - Custom components, wxCRP and more
http://www.xs4all.nl/~jorgb
email: solidstl -at- xs4all.nl
---------------------------------------------------------------