Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User hanwang's Avatar
    Join Date
    Jun 2003
    Posts
    23
    I'm writing a traditional type of Symbian 6.0 GUI. I'm trying to dynamically changing the Option menu bar.

    According to the document, I implement a DynInitMenuBarL function in myAppUI class. The function is called everytime when I press the left soft key. The problem is I don't know what to do in DynInitMenuBarL to change the menu bar.

    I call ChangeMenuBarL with a new menu bar resouce ID, but nothing changes, I always get the old menu bar. I call ConstructFromResourceL with a new resouce reader, the new menu bar appears, but on top of the old one. The old one is still there.

    Can anyone tell me how to do it? The SDK document does not cover this.

    Thanks

  2. #2
    Regular Contributor naibmys's Avatar
    Join Date
    Jun 2003
    Posts
    50
    Any time when you click the options or select a cascade menu item . system will invoke the DynInitMenuPaneL function and pass in the resource id and handle of current menu pane , so you can use the id and handle to make some menu item display or dimmed.

  3. #3
    Registered User hanwang's Avatar
    Join Date
    Jun 2003
    Posts
    23
    Thanks for the reply, but what I want to do is change all items in Option, not just dim some items. I couldn't see any method allow me to remvoe all items in the menu bar. Only ChangeMenuBarL in CEikMenuBar sounds right to me. According to the reference:ChangeMenuBarL "Dynamically changes a menu bar to use another resource. The menu bar and its relative menu pane is automatically displayed if EDisplayNow is ETrue." How come it doesn't seem to work?

  4. #4
    Regular Contributor naibmys's Avatar
    Join Date
    Jun 2003
    Posts
    50
    I think it is same as DynInitMenuPaneL(), but for menu bars.

  5. #5
    Registered User hanwang's Avatar
    Join Date
    Jun 2003
    Posts
    23
    By reading a previous question. I've got the answer to this question.

    To dynamically change the menu bar, just call

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

    But you better make the call outside of DynInitMenuBarL(), Otherwise the behavior will be weird.

    Again, ChangeMenuBarL still doesn't work.

  6. #6
    Registered User heuven's Avatar
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577
    Hi,

    indeed ChangeMenuBarL does not work - in S60 3rd FP2. Is this a known issue?

    SetMenuTitleResourceId does not take a parameter for the resource ID for the hot keys. So how to change the hotkeys + menubar for E90 if ChangeMenuBarL is not working?

    BR,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  7. #7
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    As a first try you can try using the correct SDK. There are only a few S60 3rd FP2 devices (http://www.forum.nokia.com/devices/m...3ed_fp2_1.html), and the E90 is not amongst them.

  8. #8
    Registered User marvik_34's Avatar
    Join Date
    Jun 2006
    Posts
    259
    Try with this code.
    void CDemoAppUi::DynInitMenuPaneL(
    TInt aResourceId,CEikMenuPane* aMenuPane)
    {

    if( aResourceId == R_ITEM_MENU)
    {
    /* _LIT(KClass,"fclass");
    TBuf<20> fClass;
    fClass = iDataBuf->MdcaPoint(0);
    if (fClass.Compare(KClass) == 0)
    {*/
    CEikMenuPaneItem::SData numberItems;
    numberItems.iCascadeId = 0;
    numberItems.iFlags = 0;
    if(iDataBuf != 0) // Runtime display of items inside iDataBuf
    {
    for (TInt i=0; i<iDataBuf->MdcaCount()-1;i++)
    {
    numberItems.iText = iDataBuf->MdcaPoint(i);
    numberItems.iCommandId = EVebTelDemoOne+i;
    aMenuPane->AddMenuItemL(numberItems);
    }
    }
    // }
    }

    }

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