×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    1

    Dynamic content of CAknSettingItemList

    How can I dynamicly change content of CAknSettingItemList object? Add and remove items.

  2. #2
    Super Contributor
    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
    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
    Join Date
    Jan 2006
    Posts
    15

    Re: Dynamic content of CAknSettingItemList

    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
    Join Date
    Nov 2007
    Posts
    159

    Use SetHidden

    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
  •  
×