Commands

The term command refers to events that are received when a mobile device user selects an option in the Options menu or presses a softkey (for more information, see "UI concepts"). The mobile device user input results in the application framework returning a command ID that corresponds to the softkey or Options menu selection. Command IDs are mapped to the selection options in the CBA and Menu bar resource definitions. You can use either custom command IDs, which must be defined in your application hrh resource file, or precompiled values available from the S60 platform in your resource definitions. At runtime, the application framework catches the command ID values and passes them to the application that has focus for handling. The following commands have special requirements:

For more information on resource files, see "Managing resource files".

For an example of a resource file, see "Resource management example: HelloWorldBasic".

Figure 34: Options menu

Commands are passed to the object with which the menu is associated. The object that receives the command should handle the command if it is specific to the object. If the command is relevant to another object, then it should be passed onto the other application object. The actual implementation depends on the design of your application.

If the application above uses an S60 view architecture, then the command handling functions as follows.

To handle commands, you must override CEikAppUi::HandleCommandL .

The options are as follows: