I added a list to the container in my first tab's view, things were fine until after i added the OfferKeyEventL function(below) to the container in the first view(to navigate the list ). After doing that i can't navigate between the 2 tabs:
Might be better if you would implement the tabs in the same container as your listbox is. Then at least you wouldn't have any conflict between them. I quess for some reason the listbox return KeyUsed for left&Right, so the application framework won't give them to AppUi's key-function.
If a control wishes to process key events, it should implement this function. The implementation must ensure that the function returns EKeyWasNotConsumed if it does not do anything in response to a key event — otherwise, other controls or dialogs may be prevented from receiving the key event. If it is able to process the event it should return EKeyWasConsumed.
When a key event occurs, the control framework calls this function for each control on the control stack, until one of them can process the key event (and returns EKeyWasConsumed).
Yea i guess it would work that way, since another example in the SDK does it by putting all the codes within a container rather than spreading it out to the AppUI. Funny thing is, the pdf called "Designing C++ Applications for Series 60" page 26 says that:
'If the container or one of iuts components does not consume the event, it will be passed on to the next item on the control stack'.
It also says
'The listbox is interested in key events as it consumes Up, Down, and OK Keys'.
No mention about left and right keys.....
Maybe AppUI is not on the control stack? Or maybe its becoz i'm using CKevlistAppUi::HandleKeyEventL instead of CKevlistAppUi::OfferKeyEventL. I tried the latter, and it didn't work.
Beats me really, I think that calling BaseConstructL(), should also put the AppUI to the stack and then it should get all the events it's supposed to get.
HandleKeyEventL() should be just fine and it really should get all the keyevents, so only thing that I can think is that for some reason some object is taking the left/right events before they would be passed to AppUi.
One view should be enough always. The rest depends on your solution requirements, sometimes you propably need to have as many controls (or containers) used in side your tab owning control as tabs. Then you just return right pointer in your ComponentControl()-function accordingly.
But indeed if all of the tabs are showing similar control (such as listbox) the you could also just put new iconarray & text array to the list box and call DrawNow() to re-fresh the screen
I think that u have to manually capture the left and right key events, and return a "EKeyWasNotConsumed", so that they are not passed to iListBox->OfferKeyEventL. Therefore they are then passed to the AppUI to handle the tabs.
From what i observe, i think that
will return a EKeyWasConsumed eventhough they are EKeyLeftArrow and EKeyRightArrowkey events.