Hiding item in the settinglist

Login to reply to this topic.
Sat, 2006-02-18 11:25
Joined: 2006-01-19
Forum posts: 3
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   Huh

      

Sat, 2006-02-18 17:53
Joined: 2004-05-20
Forum posts: 22
Re: Hiding item in the settinglist
Hi, siva:

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;
    }
Mon, 2006-02-20 05:52
Joined: 2006-01-19
Forum posts: 3
Re: Hiding item in the settinglist
Thanks chenziteng for the reply. I did that before and it works fine for me too. But my requirement is that..i need to hide certain setting items dynamically after it has been created and not only just after its creation. Can u please suggest something about this.

Thanks in advance.
Fri, 2006-03-17 10:42
Joined: 2005-05-12
Forum posts: 26
Re: Hiding item in the settinglist
Ever tried to use CAknSettingItemList::HandleChangeInItemArrayOrVisibility ?
When I look at the SDK doc, it says:
Quote from: S60_API_RefGuide.chm
Note that the setting item array must have be notified of this by calling CAknSettingItemList::HandleChangeInItemArrayOrVisibility
  • Login to reply to this topic.