Symbian Programming Tutorial Blog

Symbian Programming Tutorial Blog
http://www.sciabarra.com/blog/ui/2005/07/09/Menu_Resources.html

You create a menu structure using resources. Here is how. First, create the menu bar (resource MENU_BAR). Then, attach them some menu panes (resource MENU_PANE).

The menu pane contains menu items; each menu item has a display string and points to a command to be executed when user select it. Note (see here) you must define commands as an enumeration in the .hrh source file, and also you must collect display strings in some .l01 (UK English), .l02 (French) files, to be included from the .loc.

Here is an example. First the menu bar:

RESOURCE MENU_BAR r_demo_menubar {
titles = {
MENU_TITLE {
menu_pane = r_demo_menu;
}
};
}

Then the menu pane:

RESOURCE MENU_PANE r_demo_menu {
{
items = {
MENU_ITEM {
command = EHelloWorldCommand1;
txt = COMMAND_ONE;
},
MENU_ITEM {
command = EAknCmdExit;
txt = text_softkey_exit;
}
};
}
}

Note the EHelloWorldCommand1 coming from the .hrh and COMMAND_ONE included from .loc
Posted by msciab at 6:25 PM in User Interface
Comments (0)