CQikScrollableContainer Problem.

Login to reply to this topic.
Fri, 2008-08-22 10:40
Joined: 2008-03-14
Forum posts: 8

Hi,

I have a problem with CQikScrollableContainer. I have a CCoeControl derived class (CSampleView) which has a CQikScrollableContainer derived object (CScroller). I initialise CScroller object in CSampleView like below:

InitComponentArrayL();

CQikRowLayoutManager* rowLayout = CQikRowLayoutManager::NewLC();
CQikRowLayoutManager::TLayoutData rowLayoutData;
rowLayoutData.SetAlignment(CQikRowLayoutManager::EHAlignFill, CQikRowLayoutManager::EVAlignFill);
rowLayout->SetDefaultLayoutData(rowLayoutData);
CleanupStack::Pop(rowLayout);

iScroller = new (ELeave) CScroller();
iScroller->SetContainerWindowL(*this);
iScroller->SetParent(this);
iScroller->ConstructL(EFalse);
Components().AppendLC(iScroller);
CleanupStack::Pop();

iScroller->SetRect(rect);
iScroller->SetLayoutManagerL(rowLayout);

CEikScrollBarFrame* frame = iScroller->ScrollBarFrame();
frame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);
iScroller->SetPageSize(iScroller->MinimumPageSize());
iScroller->UpdateScrollBarsL();

and then add labels to the CQikScrollableContainer object like below:

void CScroller::InitAfterConstruct()
{
TPoint drawPos(10,10);
iLabelArray = new (ELeave) RPointerArray (1,257);
TBuf<5> aNum;
for (TInt i = 0;i < 15;i++)
{
CEikLabel* aLabel = new (ELeave) CEikLabel();
aLabel->SetContainerWindowL(Page());
aLabel->SetParent(this);
aLabel->ConstructL();
AddControlLC(aLabel);
CleanupStack::Pop(aLabel);
aNum.Zero();
aNum.AppendNum(i);
aLabel->SetTextL(aNum);
aLabel->SetExtent(drawPos, TSize(150,30));
drawPos.iY += 35;
iLabelArray->Append(aLabel);
}
}

I know the app has created 15 labels and the scrollbar to the right even shows that there are controls beyond the bottom of
the screen. However when I grab the scrollbar and try to move it up/down the screen does not move up or down showing the remaining labels that are not visible.

Please help


Fri, 2008-08-22 11:22
Joined: 2005-11-20
Forum posts: 1241
Re: CQikScrollableContainer Problem.

I think you should call MinimumPageSize() *after* adding the labels, and also call ActivateL() for the container at the very end.


René Brunner

  • Login to reply to this topic.