×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    21

    how to implement find box

    hi there,
    i m beginner in symbian,
    i want to implement a list box which will contain a find box,
    i have seen the same in list control example,
    but i m not getting how to implement it?

    i tried a bit, but it is giving panic Eikdpage.cpp 2388 when i try to execute the dialog

    here i m giving what i have done :
    following is my resource :

    RESOURCE DIALOG r_demo_selection_list_dialog
    {
    flags = EAknDialogSelectionList;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtSingleListBox;
    id = ESelectionListDialog;
    control = LISTBOX
    {
    flags = EAknListBoxSelectionList; array_id = r_demo_listbox_items;
    };
    },

    DLG_LINE
    {
    itemflags = EEikDlgItemNonFocusing;
    id = EAknExListDlgFindBox;
    type = EAknCtSelectionListPopupFind;
    }
    };
    }


    // * resource for the list box items

    RESOURCE ARRAY r_demo_listbox_items
    {
    items =
    {
    LBUF { txt = "\taaa"; },
    LBUF { txt = "\tbbb";},
    LBUF { txt = "\tccc";}
    };
    }



    following is my code in container::constructl() :


    void CListbox2Container::ConstructL(const TRect& aRect)
    {
    CreateWindowL();

    iLabel = new (ELeave) CEikLabel;
    iLabel->SetContainerWindowL( *this );
    iLabel->SetTextL( _L("Example View") );

    TInt openedItem(0);
    CAknSelectionListDialog* dialog = CAknSelectionListDialog::NewL(openedItem,NULL,0);
    TInt rid = R_DEMO_SELECTION_LIST_DIALOG;
    dialog->ExecuteLD(rid); <-- panics here

    SetRect(aRect);
    ActivateL();

    }

    what might be the problem?
    can anybody provide me a sample code?
    can i use list box resource with it & add the list box items through coding & not through array resource?

    thanx in advance
    rahul

  2. #2
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    328
    You are trying to launch a dialog from the ConstructL of you new container control...

    What you should be doing here is creating a container control (ie based on CCoeControl) which owns two further controls in the form of a (1) listbox and (2) a findbox.

    In the listbox example, look for the CreateFindBoxL method to find out how to create a findbox.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    21
    Hi template60,
    Thaks for replying.
    I have solved the problem using CAknSearchField.
    Anyways,
    Thank you once again,
    Rahul

Posting Permissions

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