×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    NULL menu bar in CAknViewAppUi (3rd edition)

    My AppUi class is derived from CAknViewAppUi:
    Code:
    class CMobile8AppUi : public CAknViewAppUi
    I want to display a context menu when I push the joystick (EStdKeyDevice3):
    Code:
    CEikMenuBar* crtMenuBar = iEikonEnv->AppUiFactory()->MenuBar();
    crtMenuBar->SetMenuTitleResourceId(R_MENUBAR_CTX);
    
    if(iEikonEnv->AppUiFactory()->MenuBar())
    {
    	iEikonEnv->AppUiFactory()->MenuBar()->StopDisplayingMenuBar();
    }
    
    if(iEikonEnv->AppUiFactory()->MenuBar())
    {
    	iEikonEnv->AppUiFactory()->MenuBar()->TryDisplayMenuBarL();
    }
    
    iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_MENUBAR_MAIN);
    But the menubar is NULL and my application closes:
    Code:
    CEikMenuBar* crtMenuBar = iEikonEnv->AppUiFactory()->MenuBar()
    //crtMenuBar is NULL !!!
    Is there a problem with the fact that my appUI is derived from CAknViewAppUi and not from CAknAppUi ?

    How to get that menubar?

    Please help!

  2. #2
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    Try defining also a menubar in your EIK_APP_INFO structure (in the resource file)

  3. #3
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    I fixed it by getting the menu from the view.

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

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    Hi,

    I am facing the same problem, i try to get menubar from the view's constructor and it is giving me NULL. Can you give me some pointers..

    iMenuBar = iEikonEnv->AppUiFactory()->MenuBar(); <- returning NULL
    iMenuPaneRect = iMenuBar->Size();

    Regards,
    Thomas

  5. #5
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    Quote Originally Posted by thomasleets
    Hi,

    I am facing the same problem, i try to get menubar from the view's constructor and it is giving me NULL. Can you give me some pointers..

    iMenuBar = iEikonEnv->AppUiFactory()->MenuBar(); <- returning NULL
    iMenuPaneRect = iMenuBar->Size();

    Regards,
    Thomas
    As PushL said: Try defining also a menubar in your EIK_APP_INFO structure (in the resource file)
    And I'm not sure ContructL is the right place where to get the menuBar. Are you sure it's construction was finalized?

  6. #6
    Registered User
    Join Date
    Aug 2012
    Posts
    11

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    I am also having the same problem. I have to display camera view and a menu bar when I open the application. But I only get the camera view and menu bar is hidden. I have checked the application on emulator and on pressing Ctrl+1 (softkey options) the menu bar displays the options, but it's a problem on touchphone where menu bar is hidden.
    My AppUi is inherited from CAknViewAppUi and AppView is inherited CCoecontrol. And I don't want to change any of these inheritance.

    I have tried putting below code in AppUi::ConstructL (after BaseconstructL(EAknEnableSkin)) and in AppView::ConstructL ( after ActivateL()) but none works
    CEikMenuBar* crtMenuBar = iEikonEnv->AppUiFactory()->MenuBar();
    crtMenuBar->SetMenuTitleResourceId(R_MENUBAR); //R_MENUBAR is defined in RESOURCE EIK_APP_INFO

    Hoping to get some answers

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    Quote Originally Posted by neomaxpayne View Post
    I am also having the same problem. I have to display camera view and a menu bar when I open the application. But I only get the camera view and menu bar is hidden. I have checked the application on emulator and on pressing Ctrl+1 (softkey options) the menu bar displays the options, but it's a problem on touchphone where menu bar is hidden.
    My AppUi is inherited from CAknViewAppUi and AppView is inherited CCoecontrol. And I don't want to change any of these inheritance.

    I have tried putting below code in AppUi::ConstructL (after BaseconstructL(EAknEnableSkin)) and in AppView::ConstructL ( after ActivateL()) but none works
    CEikMenuBar* crtMenuBar = iEikonEnv->AppUiFactory()->MenuBar();
    crtMenuBar->SetMenuTitleResourceId(R_MENUBAR); //R_MENUBAR is defined in RESOURCE EIK_APP_INFO

    Hoping to get some answers
    You are likely using different device than with teh original query. This thread was last updated 6 years ago, so instead of popping up really old threads, you should consider starting new ones.

    All and all, if you are not using views (i.e. you are indeed using just containers), you should not use CAknViewAppUi, instead simply use CAknAppUi

  8. #8
    Registered User
    Join Date
    Aug 2012
    Posts
    11

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    I had the same problem so I thought I shouldn't make duplicate posts and replied on this one.
    Anyway I couldn't get through that problem and changed my view back to CAknAppUi

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    ok, Can you check that you are really using CAknAppUi, and the views used in it are indeed CCoeControl based, and there are no CAknViews etc. used in any place ?

    The check that your views are only using ClientRect() given from the AppUI, and not ApplicationRect(), this would be making sure that they are not overwriting the CBA's.

  10. #10
    Registered User
    Join Date
    Aug 2012
    Posts
    11

    Re: NULL menu bar in CAknViewAppUi (3rd edition)

    thanks yucca,
    but I was having problem when I had changed to CaknViewAppUi, but I couldn't get past the NULL menu bar problem so I have changed back to CAknAppUi and it's working in it.

Similar Threads

  1. Please its veru urgent on nokia 3250
    By siva_guduru in forum Mobile Java General
    Replies: 8
    Last Post: 2008-05-01, 10:24
  2. How to draw scroll bar with skin in 3rd edition
    By ppiggy in forum Symbian User Interface
    Replies: 7
    Last Post: 2007-11-07, 14:12
  3. Replies: 0
    Last Post: 2006-02-22, 10:06
  4. TTime : TInt64& Int64() problem in S60 3rd edition
    By iulian_moldovan in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2006-01-24, 13:07
  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
  •  
×