×

Discussion Board

Results 1 to 6 of 6

Thread: CItemArray

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    How to handle menu items displayed dynamically?

    Hi,

    My application gets data items (names) from sever dynamically, recevies more than 50 data items.Data is added to menu items. When the user clicks on the particular item it performs certain operation.
    For single item
    _LIT(KName,"One");
    TBuf<10> bufOne(KName);
    CEikMenuPaneItem::SData itemOne;
    itemOne.iCommandId = EDemoOne;
    itemOne.iCascadeId = 0;
    itemOne.iFlags = 0;
    itemOne.iText = bufOne;
    aMenuPane->AddMenuItemL(itemOne);

    Using CEikMenuPane::CItemArray how to add items dynamically?
    How to assign CommandID to the menu item at runtime and click events (handle command like) for that item?

    Thanx in advance.
    Cheers
    Last edited by marvik_34; 2006-11-13 at 09:16.

  2. #2
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    How to handle menu items displayed dynamically?

    Any Solution?
    cheers

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: How to handle menu items displayed dynamically?

    Where is the question? If your snipet works, you can add items with different iCommandId-s, and you will get them in your HandleCommandL.

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: CItemArray

    Hi Wizard,
    Thankyou for replay. This code snippet is for one item. I want to wright a code for more than 50 items. When each item clicked it performs asynchronous operations
    How to wright a code using CEikMenuPane::CItemArray to display item dynamically? How to assign the iCommandIDs to these items dynamically? Bit wired up, help me.

    Cheers

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: CItemArray

    Have you heard about loops?
    Some examples: "for" "while" "do...while"
    You can assign iCommandId-s based on the highest ID you use in your static menu structure (actually starting with "EHighestID+1" to avoid duplication).

  6. #6
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: CItemArray

    Thankyou very much
    cheers

Posting Permissions

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