Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to define submenu

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: Den123 (26 Jun 2007)
Last edited: hamishwillee (30 May 2013)

In your project.rss define

RESOURCE EIK_APP_INFO
{
menubar = r_menubar;
cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
}
 
RESOURCE MENU_BAR r_menubar
{
titles =
{
MENU_TITLE { menu_pane = r_menu; }
};
}
 
RESOURCE MENU_PANE r_menu
{
items =
{
MENU_ITEM
{
command = ECommands;
txt = "Commands";
cascade = r_commands_submenu_pane;
},
MENU_ITEM
{
command = EAknSoftkeyExit;
txt = qtn_exit;
}
};
}
 
RESOURCE MENU_PANE r_commands_submenu_pane
{
items =
{
MENU_ITEM
{
command = ECommand1;
txt = "Command1";
},
MENU_ITEM
{
command = ECommand2;
txt = "Command2";
}
};
}

In your project.hrh define

enum TProjectIds
{
ECommands = 0x6001, // start value must not be 0
ECommand1,
ECommand2
};

Finally, in your AppUi class define method

void CProjectAppUi::HandleCommandL( TInt aCommand )
{
switch( aCommand )
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
 
case ECommand1:
// on command 1 action
break;
 
case ECommand2:
// on command 2 action
break;
default:
Panic( EUnknownCommand ); // from project.pan file
break;
}
}
This page was last modified on 30 May 2013, at 04:33.
53 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×