×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    How to Add menu items dynamically?

    Hi Developers,

    I get the data (column names from tables) from server, How to include as menu items in menu dynamically? (Menu item names known at runtime only).
    Thanks in advance.

    Cheer's
    Last edited by marvik_34; 2006-11-09 at 07:54.

  2. #2
    Regular Contributor
    Join Date
    Dec 2005
    Location
    Bangalore, India
    Posts
    90

    Re: How to Add menu items dynamically?

    you can check
    CEikMenuPane::AddMenuItemsL()
    Best Regards
    -Boumitran

  3. #3
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: How to Add menu items dynamically?

    May the following link helps u:

    http://discussion.forum.nokia.com/fo...ad.php?t=64338

    Regards
    symbee

  4. #4
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: How to Add menu items dynamically?

    Create a object of
    CEikMenuPaneItem::SData itemData;
    and usiing itemData you can set the fields like text, commandid, cascade, flags, have a look at the sdk.
    and then you would add itemData (here) using AddMenuItemsL() aMenuPane->AddMenuItemL(itemData);..

    i think you need to have an empty implementation for MENU_PANE in the resource file.

    Priju

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

    Re: How to Add menu items dynamically?

    Hi Priju,

    Thankyou it's working but tick and button appears on left and right side of the menu item with strike line in the middle. y, any idea?

    Cheer's

  6. #6
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: How to Add menu items dynamically?

    Quote Originally Posted by marvik_34
    Hi Priju,

    Thankyou it's working but tick and button appears on left and right side of the menu item with strike line in the middle. y, any idea?

    Cheer's
    Hi,
    could u post ur code..im not sure about the tick and the button in menu's..

    Priju

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

    Re: How to Add menu items dynamically?

    Hi,
    This in DynInitMenuPaneL() in UIQ

    if (aResourceId == R_DEMO_ITEM_MENU)
    {
    _LIT(KName,"One");
    TBuf<10> bufOne(KName);
    CEikMenuPaneItem::SData itemOne;
    itemOne.iText = bufOne;
    aMenuPane->AddMenuItemL(itemOne);
    }

    Cheer's

  8. #8
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: How to Add menu items dynamically?

    Quote Originally Posted by marvik_34
    Hi,
    This in DynInitMenuPaneL() in UIQ

    if (aResourceId == R_DEMO_ITEM_MENU)
    {
    _LIT(KName,"One");
    TBuf<10> bufOne(KName);
    CEikMenuPaneItem::SData itemOne;
    itemOne.iText = bufOne;
    aMenuPane->AddMenuItemL(itemOne);
    }

    Cheer's
    hufff....that was in UIQ..i was wondering where the ticks and buttons comes in s60. i just had a look onto the UIQ header file..i believe the tick and buttons are default in nature..hope some exp guys can help you in this..

    Priju

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

    Re: How to Add menu items dynamically?

    Hi,
    Sloved with this code
    itemOne.iCascadeId = 0;
    itemOne.iFlags = 0;
    cheer's

  10. #10
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    346

    Post Re: How to Add menu items dynamically?

    Quote Originally Posted by Priju Jacob Paul View Post
    Create a object of
    CEikMenuPaneItem::SData itemData;
    and usiing itemData you can set the fields like text, commandid, cascade, flags, have a look at the sdk.
    and then you would add itemData (here) using AddMenuItemsL() aMenuPane->AddMenuItemL(itemData);..

    i think you need to have an empty implementation for MENU_PANE in the resource file.

    Priju

    i've got a panic error
    Program QMenu::QMenu
    ERROR KERN-EXEC:3

    here is my code

    Code:
    // declare structure to hold details of menu item to add 
    CEikMenuPaneItem::SData itemData;
    // set the command for the item and any extra flags
    itemData.iText=_L("Close (debug)");
    itemData.iCommandId=EEikCmdExit;
    itemData.iFlags=0;
    itemData.iCascadeId=0;
    // add the item
    aMenuPane->AddMenuItemL(itemData);
    aMenuPane is declared in application's *view.h as

    Code:
    private:
            CEikMenuPane* aMenuPane;
    Can someone teach me how to add menu bar dynamically without any occurence of the panic and explain why i've got a panic error based on my codes?

    Please helkp me ASAP

  11. #11
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    346

    Re: How to Add menu items dynamically?

    sorry for the post below but I understand now that my codes are on wrong place.. :D

Similar Threads

  1. How to add items dynamically to the double pop menu style list box
    By vinayakak in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-12-07, 08:16
  2. add items dynamically to listbox
    By AbuElElla in forum Symbian
    Replies: 2
    Last Post: 2005-07-18, 13:47
  3. Add a menu item dynamically. URGENT !!!!!
    By jesusdol in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-01-30, 03:13
  4. Replies: 1
    Last Post: 2002-08-19, 14:28
  5. Changing menu items dynamically
    By nkn_motoko in forum Symbian
    Replies: 1
    Last Post: 2001-11-08, 18:48

Posting Permissions

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