Discussion Board
How to create 2 column list box?
2002-07-25, 10:27
#1
Registered User
Hi! I'm using CAknSingleHeadingStyleListBox in Series60 0.9 SDK. How can I make 2 column into it? I have tried:
listItem.Copy(_L("Headr\t1Col\t2Col"));
and tried to set column widths like:
CColumnListBoxData* columnData = iListBox->ItemDrawer()->ColumnData();
columnData->SetColumnWidthPixelL( 0, 30 ); //1st col
columnData->SetColumnWidthPixelL( 1, 68 ); //2nd col
, but my iListBox is type CEikTextListBox and ItemDrawer is not member of it.
RE: How to create 2 column list box?
2002-08-13, 09:41
#2
Registered User
I have implemented 3 columns in Series60 with the following code:
iListBox = new( ELeave ) CAknColumnListBox ();
iListBox->SetContainerWindowL( *this );
iListBox->ConstructL( this );
iListBox->SetRect(aRect.Size()); // wichtig
iListBox->CreateScrollBarFrameL(ETrue);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, // NO horizontal
CEikScrollBarFrame::EOn); // YES vertical
CColumnListBoxItemDrawer* drw = iListBox->ItemDrawer();
drw->ColumnData()->SetColumnWidthPixelL(0,91);
drw->ColumnData()->SetColumnWidthPixelL(1,50);
drw->ColumnData()->SetColumnWidthPixelL(2,30);
Populate the columns via \t, e.g.:
_LIT(KItem1, " Name\tScore\tLev.");
iArray = new (ELeave) CDesCArrayFlat(10);
TBuf<24> buf (KItem1);
iArray->AppendL(buf);
Regards, Holler
RE: How to create 2 column list box?
2002-08-21, 08:13
#3
Registered User
The linker errors are caused on missing libs.
Add eikcoctl.lib in your MMP file and eiktxlbm.h
in your source file. Don't forget to run
abld makefile vc6 before compiling.
Wulf
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules