×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    10

    CAknPopupList and findbox problem

    I am using a CAknPopupList and I want to add a findbox to it with EnableFind() method. It works well on emulator, but on device (Nokia 6600 V 3.42.1) it gives a LDR-IMPORT 2 panic (without findbox there is no problem). Is there any solution or any other dialog, which I could use? I tried CAknSelectionListDialog, but it has problems too, application exits when I press ABC button.

    CAknSingleHeadingPopupMenuStyleListBox* listBox = new (ELeave) CAknSingleHeadingPopupMenuStyleListBox;
    CleanupStack::PushL(listBox);

    CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuGraphicHeadingWindow);
    CleanupStack::PushL(popupList);

    listBox->ConstructL(popupList, 0);
    listBox->CreateScrollBarFrameL(ETrue);
    listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

    // set array elsewhere ...
    listBox->Model()->SetItemTextArray(array);
    listBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);

    popupList->EnableFind(ETrue); // problem

    popupList->ExecuteLD();

  2. #2
    Registered User
    Join Date
    May 2004
    Posts
    10
    I managed to solve the problem with a dialog derived class, which contains a custom control (a container with a listbox and a search field). It almost works well, except for the ABC key handling. It shows the ABC menu, but I can't choose any element of it, because if I press arrow buttons, the listbox is moving. Maybe I can solve this with OfferKeyEventL() method, but there is another problem: after the ABC menu disappears, the dialog stays greyed out. If somebody know a solution, please help. Thanks.

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    10
    I solved the problem, I am not allowing the ABC menu to appear. My code in the dialog's OfferKeyEventL() is:

    if (aKeyEvent.iModifiers & EModifierShift)
    {
    iContainer->SetFocus(EFalse);
    return EKeyWasConsumed;
    }
    if (!iContainer->IsFocused()) iContainer->SetFocus(ETrue);

    With this the CAknSearchField (which has an internal CEikEdwin) losts focus, and does not displays the menu.
    The problem is also in connection with focus, when the ABC menu appears, it does not get focus, and so does not get key events. I tried to set dialog unfocused manually, it works until the ABC menu is visible, but I don't know, when it disappears, and I can't give focus back to dialog (I don't have any idea, how I could know, when the menu disappears).
    When I use the same container (listbox and findbox) in a view (not in a dialog), there is no problem with ABC key.

Posting Permissions

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