×
Namespaces

Variants
Actions

How to define submenu

From Nokia Developer 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 07:33.
35 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.

×