OK,
I been hitting my head againts a wall for a few days now.
This is what I want to do:
- I have a CAknSingleGraphicPopupMenuStyleListBox
- I want to scroll one page at a time by hitting the left/right arrows keys
Doing the above shouldn't be difficult, but I can't seem to capture the key events in the listbox.
OK, so in my view class (the container) I have the following:
The .h file for the view (container)Code:void MyAppView::ConstructL( const TRect& aRect ) { ... cList = new( ELeave ) CAknSingleGraphicPopupMenuStyleListBox; // Initialization of cList, and CAknPopupList that contains the cList cList->SetListBoxObserver(this); ... } // Never gets called void MyAppView::HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType) { _LIT( KBusy, "I am here2-1..." ); CEikonEnv::Static()->BusyMsgL(KBusy); } // Gets called TKeyResponse MyAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) { //_LIT( KBusy, "I am here3-1..." ); //CEikonEnv::Static()->BusyMsgL(KBusy); return cList->OfferKeyEventL(aKeyEvent, aType); //return EKeyWasNotConsumed; }
In my UI class I add the view (container) to the stack:Code:class MyAppView : public CCoeControl, MEikListBoxObserver { public: void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType); TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); ... private: CAknSingleGraphicPopupMenuStyleListBox* cList;
OfferKeyEventL works fine, but HandleListBoxEventL is never called.Code:AddToStackL(iAppView);
I must be missing something obvious? someone put me out of my misery :)




