1、
Defining a Menu for Your Dialog
When the player name dialog is displayed in the SimpleDlg application, the soft keys are labeled Ok and Cancel, as shown in Figure 6-2. A more complex dialog may need to have a menu associated with it, the menu being activated by an Options soft key.
To do this, define the menu in a MENU_BAR resource, ensuring that it has an Exit option. Set the DIALOG resource buttons to an appropriate value梩his means one containing an Options soft key, such as R_AVKON_SOFTKEYS_OPTIONS_BACK. The resource is then passed through to the dialog in its ConstructL() method. To dynamically configure the menu you have to override DynInitMenuPaneL().
Note that if it is necessary to override the OkToExitL() function, then the overridden version of this function is responsible for displaying the menu. To handle custom menu commands, implement the ProcessCommandL() function. Further details on menus are available in Chapter 5.