×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    135

    How can I create dynamically a menu bar in Series80?

    How can I create dynamically a menu bar ?


    I've tried something like:
    ----------------------------------------------
    CEikMenuBar *iMenuBar = new (ELeave) CEikMenuBar;
    CleanupStack::PushL(iMenuBar);
    iMenuBar->ChangeMenuBarL(0,R_NEW_MENUBAR,ETrue);
    -----------------------
    AND
    ----------------------
    TResourceReader reader;
    iEikonEnv->CreateResourceReaderLC( reader, R_NEW_MENUBAR );
    iMenuBar->ConstructFromResourceL(reader);

    CleanupStack::PopAndDestroy();
    ------------------------

    OR

    CEikMenuBarTitle* title = new (ELeave) CEikMenuBarTitle;
    CleanupStack::PushL(title);
    title->iData.iMenuPaneResourceId = R_MENU;
    title->iData.iText = _L("hiphip");

    CEikMenuBar::CTitleArray* aTitleArray = new(ELeave) CEikMenuBar::CTitleArray;
    CleanupStack::PushL(aTitleArray);
    aTitleArray->AppendL(title);
    iMenuBar->SetMenuTitleArray(aTitleArray);
    CleanupStack::PopAndDestroy();

    -------------------------------

    But it doesn't work.

    Please help.

    Thanks

  2. #2
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    89

    Re: How can I create dynamically a menu bar in Series80?

    You can load any menu bar from resource and just edit it. Pointer to currently loaded menu bar is available via CEikonEnv::Static()->AppUiFactory()->MenuBar() . Sorry if not an answer to your problem.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    279

    Re: How can I create dynamically a menu bar in Series80?

    On s60 I use this
    iMenuBar = new CEikMenuBar();
    iMenuBar->ConstructL(this, 0, R_MENUBAR);

Similar Threads

  1. Dynamically change menu bar?
    By hanwang in forum Symbian User Interface
    Replies: 7
    Last Post: 2008-03-21, 06:48
  2. Replace Menu dynamically
    By stopin in forum Symbian C++
    Replies: 2
    Last Post: 2004-11-23, 11:27
  3. menu bar
    By stenlik in forum Symbian C++
    Replies: 0
    Last Post: 2004-11-23, 09:23
  4. Menu bar in FEP
    By kdinn in forum Symbian C++
    Replies: 0
    Last Post: 2004-05-27, 08:07
  5. Can i create manual menu bar by don't use resource
    By nick_atl2000 in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-08-17, 08:57

Posting Permissions

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