×

Discussion Board

Results 1 to 5 of 5

Thread: Listbox Issue

  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    181

    Listbox Issue

    I am using the following code to create a list box but all I see on screen is a scroll bar and no listbox. What is the problem here ?


    void CDSTAppViewContainer3::CreateListBoxL()
    { //Delete the list box if already exists.
    if ( iListBox )
    {
    delete iListBox;
    iListBox = NULL;
    }
    // listbox instance
    iListBox = new (ELeave) CEikColumnListBox();
    iListBox->ConstructL(this);
    iListBox->SetContainerWindowL(*this);
    // add scrollbars to listbox
    iListBox->CreateScrollBarFrameL(ETrue);
    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
    const TPoint aPoint(0,0);
    const TSize aSize(180,150);
    //most important line , else the list box simply disappears
    iListBox->SetExtent(aPoint,aSize);
    //Fill list box with the data
    InitListBoxL();
    iListBox->ActivateL();
    iListBox->DrawNow();
    }


    ............................................

    void CDSTAppViewContainer3::InitListBoxL()
    { // construct listbox item array
    CDesCArray *itemList = new (ELeave) CDesCArrayFlat(10);
    itemList->AppendL(_L("\tFirst item\t\t"));
    itemList->AppendL(_L("\tSecond item\t\t"));
    // set items and ownership
    iListBox->Model()->SetItemTextArray(itemList);
    iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
    iListBox->SetCurrentItemIndex(0);
    iListBox->SetFocus(ETrue);
    iListBox->HandleItemAdditionL();
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,026

    Re: Listbox Issue

    have you implemented :

    CountComponentControls() & ComponentControl( TInt aIndex ) in your view

  3. #3
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    181

    Re: Listbox Issue

    Quote Originally Posted by vineet.jain View Post
    have you implemented :

    CountComponentControls() & ComponentControl( TInt aIndex ) in your view
    Now I have.

    They r as below:

    CCoeControl* CDSTAppViewContainer3::ComponentControl( ) const
    {
    return iListBox ;
    }


    TInt CDSTAppViewContainer3::CountComponentControls() const
    {
    return 1;
    }


    But the app crashes on the return 1 line with a panic code :KERN-EXEC 3.

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,026

    Re: Listbox Issue

    have you added the container to stack, inside the DoActivateL()

  5. #5
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    181

    Re: Listbox Issue

    Quote Originally Posted by vineet.jain View Post
    have you added the container to stack, inside the DoActivateL()
    Yess ofcourse.

    The container gets created.
    I have a background image drawn on it. That gets done.
    I have a progress dialog on this container. That is working fine.
    But whenever I try to add a control, the app crashes on the line mentioned below.
    Last edited by nisheethpandey; 2009-12-14 at 10:27.

Similar Threads

  1. Custom Listbox & Scrolling on 5th edition
    By spol in forum Symbian User Interface
    Replies: 0
    Last Post: 2009-08-30, 01:54
  2. ListBox issue
    By songoku83 in forum Symbian
    Replies: 5
    Last Post: 2008-02-06, 12:22
  3. listbox with small graphic vs. listbox with large graphic
    By huami in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-08-07, 10:57
  4. Yet another listbox issue
    By larsoveclaesson in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-07-28, 08:40
  5. ListBox and resource file
    By tplinet in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-04-02, 16: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
  •  
×