Selected item index when a list contains hidden items

Login to reply to this topic.
Fri, 2008-02-01 17:09
Joined: 2007-02-01
Forum posts: 28

Ok, I give up. My problem is that I have a list box with hidden items and I’m trying to find the selected item index number that includes all items in the array, not just the visible ones.

The list is a settings list (iListbox) derived from CAknSettingItemList, in which one or two items have been hidden using
(*(iListBox->SettingItemArray()))[index]->SetHidden(ETrue);
iListBox->HandleChangeInItemArrayOrVisibilityL();

This works fine and a selected item can be correctly edited by pressing the selection key, which calls
iListBox->OfferKeyEventL (aKeyEvent, aType);

However when I attempt to amend an item from the menu softkey the edit box for list entry x is displayed, not the box for visible item x.

I’m obtaining the index using index = ListBox()->CurrentItemIndex();

How can I get the index of the item in the array rather than the

Can anyone point me in the right direction?

Thanks
Dave


Fri, 2008-02-01 21:16
Joined: 2004-09-14
Forum posts: 140
Re: Selected item index when a list contains hidden items

Generally the help file is a good place to start or failing that the header file.

See CAknSettingItemArray::ItemIndexFromVisibleIndex


Paul Todd

Mon, 2008-02-04 09:15
Joined: 2007-02-01
Forum posts: 28
Re: Selected item index when a list contains hidden items

Thanks for that - I thought I'd checked the header files, but I'd obviously overlooked that function!

Dave

  • Login to reply to this topic.