×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Jordan
    Posts
    213

    ListBox doesnt display items

    Hello Everybody,

    I am a new to Symbian C++ programming , but i have a strange issue regarding this ,,
    i have a List Box with two items, but when i am trying to scroll these items ,,no item is displayed ,, and this is my code for this ,,, and i am sure that there is no missing or incorrect code ,,, but i dont know why it did not worked,,,,

    m_pEdNumberCC = new (ELeave) CEikTextListBox ;
    m_pEdNumberCC->SetContainerWindowL(*this);
    m_pEdNumberCC->ConstructL(this);
    m_pEdNumberCC->SetBorder(TGulBorder::EWithOutline|TGulBorder::EShallowRaised);
    m_pEdNumberCC->CreateScrollBarFrameL(ETrue);

    m_pEdNumberCC->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);

    m_pEdNumberCC->SetListBoxObserver( this ) ;
    m_pEdNumberCC->UpdateScrollBarsL() ;
    m_pEdNumberCC->SetMopParent( this );

    ((CEikColumnListBox*)m_pEdNumberCC)->ItemDrawer()->SetFont( LatinBold12() ) ;

    ((CDesCArray*)((CEikTextListBox*) m_pEdNumberCC)->Model()->ItemTextArray())->AppendL(_L("+962"));

    ((CDesCArray*)((CEikTextListBox*) m_pEdNumberCC)->Model()->ItemTextArray())->AppendL(_L("+971"));

    m_pEdNumberCC->HandleItemAdditionL() ;

    Your help will be greatly appreciated ,,

    Regards,
    Leonard

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Smile Re: ListBox doesnt display items

    Hi Leonard,

    Welcome to Forum Nokia Discussion Boards. :)

    There are good examples on Forum Nokia Wiki which deal with Listbox.

    * How to create a simple listbox

    * Listbox creation using resource

    * List box example

    Just correlate your case with these examples and find out what you are missing.

    PS: Also check my signature. :)

    All the best,
    Kiran.
    Nokia Developer Wiki Moderation team

  3. #3
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Jordan
    Posts
    213

    Re: ListBox doesnt display items

    Thanks Kiran,

    even though i am a beginner to the Symbian C++, but i know how to make a listbox,, but the problem that my listbox size is :

    m_pEdNumberCC->SetExtent( TPoint( 13, 91) , TSize(52, 26) );

    it is very small listbox ,,,i dont know maybe this is the reason why my items dont appear in the listbox,,,,,i tried to reduce the cell item size ,,but it doesnt worked.


    Thanks

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: ListBox doesnt display items

    Hi,

    If you think that listbox size matters then try following:

    Code:
    m_pEdNumberCC->SetExtent( TPoint( 13, 91), m_pEdNumberCC->MinimumSize() );
    Anyways i would still suggest you to correlate your listbox code with existing Wiki articles. You may find some minor problem at your end.

    Kiran.
    Nokia Developer Wiki Moderation team

  5. #5
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Jordan
    Posts
    213

    Re: ListBox doesnt display items

    Thanks Kiran,

    It is working now :)

Similar Threads

  1. Adding Items to Custom ListBox at runtime
    By nickyc in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-05-01, 14:15
  2. How to modify listbox items in a findbox view?
    By inc0gn1t007 in forum Symbian User Interface
    Replies: 3
    Last Post: 2006-05-03, 17:53
  3. listbox items not visible........
    By Neelakantan in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-01-12, 05:29
  4. Replies: 3
    Last Post: 2005-01-12, 03:03
  5. Listbox Display
    By shilpav in forum Symbian User Interface
    Replies: 2
    Last Post: 2004-11-08, 07:37

Posting Permissions

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