×

Discussion Board

Results 1 to 2 of 2

Thread: dynemic menu

  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    153

    dynemic menu

    Hello everyone!!!!!!!11

    I am making an application in which i need to include the
    "Dynemin Menu" (Means during the run time when i press the one menu it will be closed and open the new menu like that.....)

    I follo the Forumnokia link
    "http://wiki.forum.nokia.com/index.php/Dynamic_menu" in which the code was as: -

    Dynamic menu
    From Forum Nokia Wiki
    Dynamically show or hide menu item

    Dynamic menu handling is made quite easy with the S60 platform, basically all you need to do is to overwrite the DynInitMenuPaneL() method in your application user interface class and link application against eikcoctl.lib. Following sample code shows an example of the DynInitMenuPaneL()method implementation:

    void CMyAppUi:ynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
    {

    if (R_MAIN_MENU == aResourceId)
    {
    if (iRegistered)
    {
    aMenuPane->SetItemDimmed(ERegisterCmd, ETrue);
    }

    }
    else if (R_ADD_MENU == aResourceId)
    {
    CEikMenuPaneItem::SData data;
    data.iText.Copy(KtxAddCommand);
    data.iCommandId = EAddCommand;
    data.iCascadeId=0;
    data.iFlags=0;
    data.iExtraText=KNullDesC;

    aMenuPane->AddMenuItemL(data);
    }
    }

    Note that before you modify the menu pane you need to check which menu pane of your application you are using, this one can be done be checking which menu pane resource ID is supplied to the function. Note also that the aResourceId is the resource id for MENU_PANE not the resource id for MENU_BAR.

    This function is called just before the menu pane is shown in the application, Calling SetItemDimmed() with ETrue will dim the menu item, which is S60 mean hiding the menu item from the list, thus users will not see any of the dimmed items.

    You can use all functions defined for the CEikMenuPane when you are in the DynInitMenuPaneL()method. For example you can also add menu items as shown in the sample code.

    The resource definition used with the sample code looks like this:

    RESOURCE MENU_BAR r_main_menubar
    {
    titles =
    {
    MENU_TITLE
    { menu_pane = r_main_menu; txt = "Options";}
    };
    }
    RESOURCE MENU_PANE r_main_menu
    {
    items =
    {
    MENU_ITEM
    { command = ERegisterCmd; txt= "Register";},
    MENU_ITEM
    { command = ENMsg;cascade=r_add_menu; txt="Add";},
    MENU_ITEM
    { command = EAbout; txt="About";}
    };
    }

    RESOURCE MENU_PANE r_add_menu
    {
    items =
    {
    MENU_ITEM
    { command = EAnotherCmdA; txt= "Another A";},
    MENU_ITEM
    { command = EAnotherCmdB; txt= "Another B";}
    };
    }

    Dynamically change entire menu bar

    If you want to change your entire menu content from R_MAIN_MENU to R_ADD_MENU, then you could call this function in your cpp source.

    iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_ADD_MENU);

    But please be noted, we'd better do not call this from the DynInitMenuPaneL() function, because this behavior will cause weired phenomenons that even the wizards from 2-6 Boundary Row, Southwark, London could not help so much.


    AFTER include the upper code still my application not working?
    after pressing the option button on my installed application it disappered??


    CAN ANYONE REALLY HELP??


    Your friend

    Pankaj.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: dynemic menu

    Quote Originally Posted by pankaj gupta55 View Post
    after pressing the option button on my installed application it disappered??
    You have a panic, reveal it via applying http://wiki.forum.nokia.com/index.ph...ded_panic_code
    I will not check your other threads/post, but I can not believe that this has not been suggested to you so far...
    CAN ANYONE REALLY HELP??
    You should "REALLY" get that panic code.

Similar Threads

  1. How to desactivate the Menu Key ?...
    By GeKI in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-10-22, 10:02
  2. creating menu and sub menu
    By hasiamar in forum Symbian User Interface
    Replies: 3
    Last Post: 2006-10-23, 16:21
  3. slide menu in j2me
    By afka in forum Mobile Java General
    Replies: 4
    Last Post: 2006-09-04, 09:10
  4. CBA, menu and key events
    By joker_pl in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-09-19, 10:27
  5. Menu bar in FEP
    By kdinn in forum Symbian
    Replies: 0
    Last Post: 2004-05-27, 08:07

Posting Permissions

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