×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    6

    Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S60v5?

    On S60v5, I used view-container-ListBox(subclass of CAknSingleGraphicStyleListBox)+CEikGlobalTextEditor. This listbox is a multiple selection one.
    I called CAknSingleGraphicStyleListBox::SetListBoxObserver in Container::ConstructL. When user selects/unselects one item of listbox, system will call HandleListBoxEventL(EEventItemClicked), and call OfferKeyEventL(aKeyEvent.iCode==EKeyDevice3) which is not my expected.

    Please help me to figure out why this unexpected OfferKeyEventL happened and how I change code.

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Location
    Beijing, China
    Posts
    538

    Re: Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S6

    transfer the key to your list box in Container::OfferKeyEventL(), like
    Container::OfferKeyEventL()
    {
    return listbox->OfferKeyEventL();
    }

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6

    Re: Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S6

    But I have two controls, one is listbox, another is CEikGlobalTextEditor.
    OfferKeyEventL():
    if(aType == EEventKey)
    switch (aKeyEvent.iCode)
    {
    case EKeyEnter:
    case EKeyDevice3:
    {
    if(iEdwinQuery->IsFocused())
    {
    // Always go to here
    }
    else
    {
    return listbox->OfferKeyEventL();
    }
    ...

    But when I debug, listbox can not get focused. I do not know why.

  4. #4
    Super Contributor
    Join Date
    Jul 2007
    Location
    Beijing, China
    Posts
    538

    Re: Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S6

    You need to manage the focus distribution between child controls by using CCoeControl::SetFocus()

Similar Threads

  1. HandleListBoxEventL not being called when enter key pressed
    By TorrinLynn in forum Symbian User Interface
    Replies: 17
    Last Post: 2010-08-06, 03:34
  2. Replies: 9
    Last Post: 2009-01-27, 13:55
  3. Replies: 4
    Last Post: 2008-05-13, 10:21
  4. Replies: 1
    Last Post: 2003-08-23, 08:59
  5. argh! HandleListBoxEventL vs OfferKeyEventL
    By advocatee in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-07-13, 10:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •