Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User vzblk's Avatar
    Join Date
    Oct 2004
    Posts
    1
    How can I dynamicly change content of CAknSettingItemList object? Add and remove items.

  2. #2
    Nokia Developer Champion stenlik's Avatar
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037
    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

  3. #3
    Regular Contributor WinHw's Avatar
    Join Date
    Jun 2003
    Location
    Jakarta, Indonesia
    Posts
    164
    Hi, too difficult to explain how to do it, but you can find an example in Series60Ex\Listbox example.


    BR

    Win

  4. #4
    Registered User Anssi Nurminen's Avatar
    Join Date
    Jan 2006
    Posts
    15
    There's nothing mystical about it. ;)

    Create an item:

    Code:
    CAknEnumeratedTextPopupSettingItem* item = new ( ELeave) CAknEnumeratedTextPopupSettingItem( 0, iSelection);
    item->ConstructL( EFalse, itemId, itemTitle, NULL, 0, EAknCtPopupField);
    And add it to your CAknSettingItemList:
    Code:
    list->SettingItemArray()->AppendL( item);
    list->SettingItemArray()->RecalculateVisibleIndicesL(); 
    list->ListBox()->HandleItemAdditionL();
    Removal should work the same way with list->SettingItemArray()->Delete( i);

  5. #5
    Regular Contributor nadav70's Avatar
    Join Date
    Nov 2007
    Posts
    159
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved