Is there a straightforward way to active multiple items in a wxListCtrl? The EVT_LIST_ITEM_ACTIVATED macro only handles a single item (as far as I can tell). The only way I can think of to do this is the following:
1. Handle the ITEM_SELECTED and ITEM_DESELECTED events.
2. Keep a list of the currently selected items (added on ITEM_SELECTED, removed on ITEM_DESELECTED).
3. In ITEM_ACTIVATED, use the list of selected items as my parameters instead of event.GetIndex().
Is this the best approach, or is there something I am missing?
Obviously this will only work for the enter key or a menu item / button, as double clicking will select one item and then activate it.
Activating multiple items in a wxListCtrl?
-
- Earned some good credits
- Posts: 120
- Joined: Sun Aug 29, 2004 3:09 pm
- Location: Grenoble, France
- Contact:
First, the style must not have wxLC_SINGLE_SEL.
Second, if I understand correctly, your can use GetSelectedItemCount() and GetNextItem() with correct params.
wxListCtrl::GetNextItem (with an example) : http://www.wxwidgets.org/manuals/2.6.0/ ... etnextitem
Second, if I understand correctly, your can use GetSelectedItemCount() and GetNextItem() with correct params.
wxListCtrl::GetNextItem (with an example) : http://www.wxwidgets.org/manuals/2.6.0/ ... etnextitem
What is little and green, witch go up and down ??
Yoda playing with the force.
Yoda playing with the force.