×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    40

    How to Display corresponding forms by clicking on corresponding listbox.

    Hi,
    All
    I am new learner of Symbian C++ ..... S60. I have designed a list box ..

    RESOURCE LISTBOX r_akn_My_list
    {
    array_id = r_akn_My_list_items;
    flags = EAknListBoxSelectionList;
    }

    RESOURCE ARRAY r_akn_My_list_items
    {
    items =
    {
    LBUF
    {
    txt = str_default_My_entry1; // defined in MylistBox.loc
    },
    LBUF
    {
    txt = str_default_My_entry2;
    },
    LBUF
    {
    txt = str_default_My_entry3;
    }
    };
    }


    Now i want to display three froms say form1 form2 and form3 ... ... ... when i select any list box and press ok (CBA) ... it should open respective form..... say...............
    Listbox "str_default_My_entry1" should open form1;
    Listbox "str_default_My_entry2" should open form2;
    Listbox "str_default_My_entry3" should open form3;

    Please help me out .... where and how can I handle these events ....???
    Thanks & Regards

    Jyotideep Bhuyan

  2. #2
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: How to Display corresponding forms by clicking on corresponding listbox.

    You have to derive your container from MEikListBoxObserver. In ConstructL code this

    in .h
    CEikTextListBox* iTextListBox;
    CDesC16ArrayFlat* iArray;

    in .cpp
    iStringArray = iEikonEnv->ReadDesCArrayResourceL(R_AKN_MY_LIST_ITEMS);
    iTextListBox = new (ELeave) CEikTextListBox;
    iTextListBox -> ConstructL(this,0);
    iTextListBox -> SetPosition(TPoint(0,0));
    iTextListBox -> SetSize(rect.Size());
    iTextListBox -> SetListBoxObserver(this);
    CTextListItemDrawer* drawer = static_cast<CTextListItemDrawer*>(iTextListBox -> View() -> ItemDrawer());
    drawer -> SetFont(iEikonEnv->LegendFont());
    iTextListBox -> Model() -> SetItemTextArray(iArray);
    iTextListBox -> SetFocus(ETrue);

    in destructor
    if(iArray)
    iArray->Reset();

    and in HandleListBoxEventL ///From MEikListBoxObserver

    void CContainer::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
    {
    if(aEventType == EEventItemClicked || aEventType == EEventEnterKeyPressed )
    {
    switch( aListBox->CurrentItemIndex() )
    {
    case 0:
    {
    ///////// Code to call your form1
    }
    case 1:
    {
    ///////// Code to call your form2
    }
    }
    }

    cheers
    Last edited by marvik_34; 2006-11-29 at 07:56.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    40

    Smile Re: How to Display corresponding forms by clicking on corresponding listbox.

    Thanks buddy................ it works!
    Thanks & Regards

    Jyotideep Bhuyan

Similar Threads

  1. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  2. Nokia N-Series Complete Model Line-Up
    By Dopod in forum General Development Questions
    Replies: 6
    Last Post: 2008-07-22, 20:16
  3. How to display Chinese in listbox
    By mobilepig in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-05-19, 14:10
  4. Listbox Display
    By shilpav in forum Symbian User Interface
    Replies: 2
    Last Post: 2004-11-08, 07:37
  5. Replies: 0
    Last Post: 2003-03-06, 11:43

Posting Permissions

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