×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    problem with listbox display

    i have following code in appview.constructl

    iFont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);

    iSearchList = new (ELeave) CAknSingleStyleListBox();
    iSearchList->ConstructL(this);
    iSearchList->SetContainerWindowL(*this);
    iSearchList->CreateScrollBarFrameL(ETrue);
    iSearchList->ScrollBarFrame()->SetScrollBarVisibilityL(
    CEikScrollBarFrame::EOn,
    CEikScrollBarFrame::EAuto);

    iItemList = new (ELeave) CDesCArrayFlat(3);
    iSearchList->Model()->SetItemTextArray(iItemList);
    iSearchList->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
    iSearchList->MakeVisible(ETrue); // show "no results" at startup
    iSearchList->SetListBoxObserver(this);
    SetRect(aRect);
    ActivateL();
    MakeVisible(ETrue)


    another piece of code called through appui.handlecommandl()
    _LIT(KBuf,"hello");
    TBuf<20> asd(KBuf);
    CDesCArray* array = new (ELeave) CDesCArrayFlat(3);
    array->AppendL(asd);
    iSearchList->Model()->SetItemTextArray(array);//(this should show hello, but shows an empty box)-----------how to fix it
    iSearchList->MakeVisible(ETrue);
    iSearchList->SetCurrentItemIndexAndDraw(0);
    SizeChanged();
    iSearchList->ActivateL();

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: problem with listbox display

    try adding _LIT(KBuf,"\thello"); instead of _LIT(KBuf,"hello");. i.e. you do need to check the column format used with the listbox you are using.

  3. #3
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: problem with listbox display

    you could have continued with your older thread: http://www.developer.nokia.com/Commu...CDesCArrayFlat

    Anyways, have you implemented the two functions CountComponentControl() & ComponentControl() inside the container which you construct the listbox?

    you may refer this complete example depicting how to construct& display listbox & see where you are going wrong : http://www.developer.nokia.com/Commu...ymbian_C%2B%2B

  4. #4
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: problem with listbox display

    hi,
    using _LIT(KBuf,"\thello"); instead of _LIT(KBuf,"hello");. works fine. thanks

Similar Threads

  1. Replies: 3
    Last Post: 2009-07-31, 14:06
  2. ListBox display problem
    By patrickfrei in forum Symbian
    Replies: 7
    Last Post: 2007-11-09, 19:53
  3. "Listbox doesn't display" problem
    By strepkoff in forum Symbian User Interface
    Replies: 6
    Last Post: 2007-04-26, 20:02
  4. Display problem in second listbox???
    By chandantheracer in forum Symbian
    Replies: 1
    Last Post: 2007-04-18, 12:19
  5. Display Problem in ListBox
    By ctrl-d in forum Symbian
    Replies: 2
    Last Post: 2006-06-19, 06:26

Posting Permissions

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