×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    14

    dynamically show menu on softkey

    I have a menu bar with cba = R_AVKON_SOFTKEYS_EMPTY so on left softkey is not shown menu. Now I want to show menu on left softkey. Because UI's HandleCommandL is not automatically invoked (softkeys are empty) I'm using:

    iEikonEnv->AppUiFactory()->MenuBar()->TryDisplayMenuBarL();

    The menu is displayed. It's OK. But then is automatically selected first item in the menu and menu close. I think it's because I dynamically invoke menu on softkey and it is propagated further. Even I'm using EKeyWasConsumed... I need menu opened.

    Can you help me, please?

    Thank you

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

    Re: dynamically show menu on softkey

    where and how you are calling the TryDisplayMenuBarL ?

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    14

    Re: dynamically show menu on softkey

    Quote Originally Posted by symbianyucca View Post
    where and how you are calling the TryDisplayMenuBarL ?
    Code:
    TKeyResponse CNakupovaniAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType):
    {
    	switch (aKeyEvent.iScanCode) {
    		case 164: { //left softkey
    		        iEikonEnv->AppUiFactory()->MenuBar()->TryDisplayMenuBarL();
    			return EKeyWasConsumed;
    		}
    			break;
    		case 165: { //right softkey
    			STATIC_CAST(CNakupovaniAppUi*, iAvkonAppUi)->HandleCommandL(EEikCmdExit);
    			return EKeyWasConsumed;
    		}
    			break;
    	}
    }

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

    Re: dynamically show menu on softkey

    What would be the point of notr defining the CBA's is the default functionality is still expected ?

    Also note that there are down-keyeve-up events generated for all keys.

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    14

    Re: dynamically show menu on softkey

    Quote Originally Posted by symbianyucca View Post
    What would be the point of notr defining the CBA's is the default functionality is still expected ?
    I'm making an app for blind people so I'm using the Mobile reader, that reads text on the screen. The reader reads softkeys names everytime it reads a text on the screen. For my app it's better to hide softkeys names and invoke menu when user press softkeys as is usual on symbian.

    Quote Originally Posted by symbianyucca View Post
    Also note that there are down-keyeve-up events generated for all keys.
    The OfferKeyEventL function was only the example. I ignore events other then keydown.

    At this time I simply call TryDisplayMenuBarL again in HandleCommandL and I ignore first call to the first command in the menu. The second call to HandleCommandL (from revoked menu) I handle in usual way. But it's not nice solution. Can I do it better.

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

    Re: dynamically show menu on softkey

    you could always just have your own CBA added, with EAknSoftkeyOptions & exit commands and empty strings as a text. Then you could do teh things normally..

Similar Threads

  1. createImage() exceptions
    By apnasi in forum Mobile Java General
    Replies: 62
    Last Post: 2010-07-24, 16:16
  2. Replies: 2
    Last Post: 2009-03-14, 07:55
  3. How to show the calendar menu of a DateField?
    By Pepper_91 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2006-08-03, 19:04
  4. Show Text Dialog with Menu
    By deepbeat in forum Symbian User Interface
    Replies: 8
    Last Post: 2006-07-07, 04:38
  5. Application doesn't show up in menu on phone
    By gijsbert in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2005-02-08, 21: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
  •  
×