I have a dialog app with multiple levels. For example, when the app comes up, the initial screen has some choices:
==========
Choice1
Choice2
Choice3
Suppose Choice1 is selected. Another screen comes up -- it has:
SubChoice1
SubChoice2
If SubChoice1 is selected, then a dialog box comes up with some controls.
The Options menu would have Help and Exit for each screen.
==========
If I just use
CAknSelectionListDialog* dialog = CAknSelectionListDialog::NewL(idx,
NULL, R_APITESTER_MENUBAR);
all my dialog dispatching works fine. In the main view, I do:
if (dialog->RunLD ()) {Dispatch (idx)}
where Dispatch does a NewL on the proper dialog. When I hit the OK key,
RunLD returns. HOWEVER, THE OPTIONS AND BACK MENUS DON'T WORK..
So, to get the Options and Back menus to work, I derived classes from CAknSelectionListDialog, and in my OkToExitL, I process EAknSoftkeyOptions and EAknSoftkeyBack. This seems to work fine. I also overrode OfferKeyEventL and processed the up and down arrows, so they would work, and they work fine. I always return CAknSelectionListDialog::OfferKeyEventL.
However, when I hit the OK key (the select key -- the key in the middle of the emulator with the 4 arrows around it), nothing happens. In my OfferKeyEventL I process aKeyEvent.iCode == EKeyOK. [At this point, I want to NewL my SubChoice dialog. I don't seem to have the index, though. Also, I'm not sure I should be doing it here.]
I figured that if in OfferKeyEventL, if I just return CAknSelectionListDialog::OfferKeyEventL, then the OK key would do the right thing (like the up and down arrows do), and my dialog dispatching would work. But when I hit the OK key, RunLD doesn't return.
Main question is: IS THERE SOMETHING ELSE I HAVE TO PROCESS IN MY OFFERKEYEVENTL METHOD?
Also: IS OFFERKEYEVENTL A PLACE TO DO NEWL ON NEW DIALOGS?
What I really need is the source to some of the emulator apps that do this -- I'm not sure I'm on the right track.