Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Create scroll bar in multiview

2 replies · 3,093 views · Started 09 April 2005

Hi!
I have a listbox in multiview application (AppUI contains View, View contains Container and Container has iListbox), but when I set it's scrollbar, it doesn't appear.
However when I use this code into single view (AppUI contains Container), the a scrollbar appear!
Here my code created the container:
Code:
void CMy_ListboxContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();

//list box
iListBox = new( ELeave ) CEikTextListBox();

iListBox->ConstructL(this, 1);
//iListBox->ConstructL(this, EAknListBoxSelectionList);

iListBox->SetContainerWindowL(*this);
iItemArray= InitListBoxData();
iListBox->Model()->SetItemTextArray(iItemArray);
iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
//The model does not own the item array � you must maintain a pointer to it and free it explicitly before your program exits
iListBox->HandleItemAdditionL();
iListBox->SetListBoxObserver(this);

// Creates scrollbar for list box
iListBox->CreateScrollBarFrameL(ETrue);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

SetRect(aRect);
ActivateL();
}

How can I solve this proplem?
Thanks in advance!

I have same type of broblem i use almost same code that you have written but without the scroll bar. Emulator starts but i can't scroll list. Adding the scrollbar...

// Creates scrollbar for list box
iListBox->CreateScrollBarFrameL(ETrue);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

...gives errors...
Link error: undefined symbol: classCEikScrollBarFrame *
CeikListBox::CreateScrollBarFrameL(int)
(?CreateScrollBarFrameL@EikListBox@@QAEPAVCEikScrolBarFrame@@H@Z)'
Link error: referenced from 'void CMuistipeliS60Container1::ConstructL(class TRect
const &😉 (?Construct@MuistipeliS60Container1@@AEXABVTRect@@@Z)' in
MuistipeliConttainer1.cpp:65

..and so on..

I found the code at "Programming for the series 60 platform and symbian os" book
but I can't get it working in multiview program... I have added the dictionaries that was in the book, but errors are still the same.