×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    6

    Help me, CAknSettingListItem problem!

    Hi all,
    I have a complex control in my view. the complex control contains a setting list. when my application running, I can see the setting list, but when I press the OK key to edit setting list item, EditItemL() is called but take no effect, setting page doesn't appear. what's wrong? I use the following code.
    //Setting item list.
    class CClientSettings : public CAknSettingItemList
    {
    public:
    ....
    void ConstructL();
    void EditItemL(TInt aIdx, TBool aCallFromMenu);
    ....
    }
    void CClientSettings::ConstructL()
    {
    TResourceReader _rr;
    iCoeEnv->CreateResourceReaderLC(_rr, R_CLIENT_SETTING_DESC);
    ConstructFromResourceL(_rr);
    CleanupStack::PopAndDestroy();
    }
    void CClientSettings::EditItemL(TInt aIdx, TBool aCallFromMenu)
    {
    CAknSettingItemList::EditItemL(aIdx, aCallFromMenu);/*take no effect, also no leave.*/
    (*SettingItemArray())[aIdx]->UpdateListBoxTextL();
    (*SettingItemArray())[aIdx]->StoreL();
    }
    //Mey complex control container.
    class CSettingsContainer : public CCoeControl
    {
    public:
    ...
    void ConstructL(const TRect& aRect);
    TInt CountComponentControls()const{ return 1; }
    CCoeControl ComponentControl(TInt aIdx)const
    { return aIdx?NULL:iSettingList;}
    TKeyResponse OfferKeyEventL(const TKeyEvent& aEv,
    TEventCode aCode)
    {
    return iSettingList->OfferKeyEventL(aEv, aCode);
    }
    private:
    CClientSettings* iSettingList;
    ...//other controls.
    }
    void CSettingsContainer::ConstructL(const TRect& aRect)
    {
    // Create a window for this application view
    CreateWindowL();

    iSettingList= new(ELeave)CClientSettings;
    iSettingList->SetContainerWindowL(*this);
    iSettingList->SetMopParent(this);
    iSettingList->ConstructL();

    // Set the windows size
    SetRect(aRect);

    // Activate the window, which makes it ready to be drawn
    ActivateL();
    }
    //Setting list resource.
    RESOURCE AVKON_SETTING_PAGE r_personal_nickname
    {
    number = EAknSettingPageNoOrdinalDisplayed;
    label = view_idle_name;
    type = EEikCtEdwin;
    editor_resource_id = r_personal_nickname_editor;
    }
    RESOURCE EDWIN r_personal_nickname_editor
    {
    maxlength = 32;
    }
    RESOURCE AVKON_SETTING_ITEM_LIST r_personal_setting_list
    {
    flags = EAknSettingItemIncludeHiddenInOrdinal;
    title = tab_self_sets;
    initial_number = 1;
    items =
    {
    AVKON_SETTING_ITEM
    {
    identifier = ESetNickname;
    setting_page_resource = r_personal_nickname;
    name = view_idle_name;
    }
    };
    }

    am I doing right way? thanks!
    Last edited by Arthur.Wang; 2008-11-20 at 02:56.
    Regards!
    Arthur.

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    6

    Re: Help me, CAknSettingListItem problem!

    I also override CreateSettingItemL() in CClientSettings.
    CAknSettingItem* CClientSettings::CreateSettingItemL(TInt aSettingId)
    {
    CAknSettingItem* _pSi = NULL;
    switch(aSettingId)
    {
    case ESetNickname:
    {
    _pSi = new(ELeave)CAknTextSettingItem(aSettingId, iNickname);
    break;
    }
    default:
    break;
    }
    return _pSi;
    }
    Last edited by Arthur.Wang; 2008-11-20 at 03:20.
    Regards!
    Arthur.

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×