How can I dynamicly change content of CAknSettingItemList object? Add and remove items.
How can I dynamicly change content of CAknSettingItemList object? Add and remove items.
Hi,
I am not sure if I am right, but as far as I know all setting items must be created in CreateSettingItemL() method based on their resource definitons. And there si no way how to "insert" new setting items afterwards. The only way - which I never tested - could be creating all setting items and hide some of them, becouse base class CAknSettingItem contains method SetHidden(). After calling it may kind of refresh is necessary - but as I said I never test it.
God bless
STeN
Hi, too difficult to explain how to do it, but you can find an example in Series60Ex\Listbox example.
BR
Win
There's nothing mystical about it. ;)
Create an item:
And add it to your CAknSettingItemList:Code:CAknEnumeratedTextPopupSettingItem* item = new ( ELeave) CAknEnumeratedTextPopupSettingItem( 0, iSelection); item->ConstructL( EFalse, itemId, itemTitle, NULL, 0, EAknCtPopupField);
Removal should work the same way with list->SettingItemArray()->Delete( i);Code:list->SettingItemArray()->AppendL( item); list->SettingItemArray()->RecalculateVisibleIndicesL(); list->ListBox()->HandleItemAdditionL();
Hi,
Saw this old discussion, and thought to suggest a solution to those who would have the same probelm.
So reading the above, I think the best way is a combination between the two approaches:
You need to use SetHidden, in order to avoid creation and deletion, but then you must call RecalculateVisibleIndicesL, or the showing/hiding has no effect.
Cheers,
Nadav