Hiding item in the settinglist
| Sat, 2006-02-18 11:25 | |
|
Hi
I was trying to hide a settingitem in the settinglist. I wrote the following code void CMopedUIContainer::HideSettingItem(TInt aSettingValue) { CAknSettingItemArray* settingArray ; settingArray = iSettingsList->SettingItemArray( ); TInt count; count = settingArray->MdcaCount( ); ((*settingArray)[index])->SetHidden(ETrue); DrawNow(); } whr iSettingsList is my settingList. But this is not getting hidden.I am calling this funtion after creating the settingLIst Can u suggest why this is not working Thanks in advance. Regards Siva ![]() |
|







Forum posts: 22
I managed to make the setting list item visible/invisible just after its construction, see:
// .h
class CMySettingList : CAknSettingItemList
{
...
private:
TBool iVisible;
CMySettings& iSettings;
};
// .cpp
//from CAknSettingItemList
CAknSettingItem* CMySettingContainer::CreateSettingItemL(TInt aSettingId)
{
/*
NOTE: the viable pass its reference into CAknSettingItem as its external data
the CAknSettingItem will maintain internal data, whose init value is external data
after calling StoreL(), the external data will be replaced by internal data
*/
CAknSettingItem* settingItem = NULL;
switch (aSettingId)
{
case EMySettingItemSound:
{
settingItem = new (ELeave)CAknEnumeratedTextPopupSettingItem(
aSettingId, (TInt&)iSettings.GetSoundMode());
break;
}
case EMySettingItemVolume:
{
settingItem = new (ELeave)CAknVolumeSettingItem(
aSettingId, iSettings.GetVolume());
settingItem->SetHidden(!iVisible); <=====
break;
}
default:
{
break;
}
}
return settingItem;
}
Forum posts: 3
Thanks in advance.
Forum posts: 26
When I look at the SDK doc, it says: