Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User -janine's Avatar
    Join Date
    Apr 2004
    Location
    Finland
    Posts
    10
    Hi,

    I have a CEikColumnListBox in my application. When I start the application the items of the list are not visible. However, if I scroll the list, the parts that come from "under" the frame, are visible.

    My application is on Series 90 but it is very likely, that it has nothing to do with it. Instead I think that it has something to do with the order of drawing, because the list goes white again if I call DrawNow() or Draw Deferred() to the view, where the list is. However, calling those to the list doesn't help.

    I also have another problem with the list: the vertical scrollbar doesn't work (horizontal works fine). Nothing happens if I tap the arrowhead of the scrollbar. I can drag the scroller of the scrollbar and it moves but the list doesn't move.

    Here is the code where I create the list:
    iListBox = new (ELeave) CEikColumnListBox();
    CleanupStack::PushL(iListBox);
    iListBox->ConstructL(STATIC_CAST(CCoeControl*, this));
    CleanupStack::Pop();

    iListBox->SetContainerWindowL(*this);
    iListBox->CreateScrollBarFrameL(ETrue);
    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn, CEikScrollBarFrame::EOn);

    CColumnListBoxData* columnData = iListBox->ItemDrawer()->ColumnData();
    columnData->SetColumnWidthPixelL(0,150);
    columnData->SetColumnWidthPixelL(1,150);

    CDesCArrayFlat* listBoxItems = iCoeEnv->ReadDesCArrayResourceL(R_LIST_ITEMS);
    iListBox->Model()->SetItemTextArray(iSongArray);
    iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
    iListBox->HandleItemAdditionL();

    TRect rect(10, 10, 170, 240);
    iListBox->SetRect(rect);

    iListBox->UpdateScrollBarsL();
    iListBox->SetFocus(ETrue);


    Thanks in advance for any ideas,
    -janine

  2. #2
    Super Contributor sopta007's Avatar
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    I don't see any real problems here...
    But you should try also these:

    iListBox->SetPosition();
    iListBox->SetSize();
    iListBox->DrawNow();

    and are the other controls in the container drawn correctly?
    Maybe you have missed these in YourContainer::ConstructL():

    SetRect(aRect);
    ActivateL();
    MakeVisible(ETrue);

    and are you sure that iSongArray already contains some items?

    and one more comment: You should never put member variable to the cleanupstack: CleanupStack::PushL(iListBox); if there are problems it will be deleted twice, and the application will panic!!

  3. #3
    Registered User -janine's Avatar
    Join Date
    Apr 2004
    Location
    Finland
    Posts
    10
    Thanks for the advice.

    The real problem was in the methods CounComponentControls() and ComponentControl().

    -janine

  4. #4
    Super Contributor sopta007's Avatar
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    yeah, it is a common mistake to forget about these...:-)

  5. #5
    Super Contributor amitaggarwal's Avatar
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605
    Dear Friends ,
    I m struggling to create a List Box.

    I select a menu item.Now i want to create a List Box.

    What all classes do i need to make ? what code shall i write in APPUI. Also How to handle the view( i have one MyAppView Class).If i need a seperate view , How to create it and use it to show list box.

    Can u guys throw some light on it .

  6. #6
    Super Contributor sopta007's Avatar
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    please look in SDK's help and examples. There is one called ListBox and it should answer all your questions (though I must say that it is little bit complicated)...
    also there is a very nice tutorial here: http://www.newlc.com/article.php3?id_article=136

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved