textinput/peninputcommonctrls/src/peninputselectionlist/peninputscrollablelist.cpp
branchRCL_3
changeset 11 c8fb4cf7b3ae
parent 9 e6a39382bb9c
child 12 5e18d8c489d6
equal deleted inserted replaced
9:e6a39382bb9c 11:c8fb4cf7b3ae
   543     {
   543     {
   544     CalculateItemWidth();
   544     CalculateItemWidth();
   545     CalcPageInfo();
   545     CalcPageInfo();
   546     iContentRect = TRect(TPoint(), TSize(2*iHorizontalMargin + iItemSize.iWidth, 
   546     iContentRect = TRect(TPoint(), TSize(2*iHorizontalMargin + iItemSize.iWidth, 
   547                        (iOnePageItemCnt + 1)*iVerticalMargin + iOnePageItemCnt*iItemSize.iHeight));
   547                        (iOnePageItemCnt + 1)*iVerticalMargin + iOnePageItemCnt*iItemSize.iHeight));
   548     TRect ctrlRect = iContentRect;
       
   549 
       
   550     iItemRects.Reset();
       
   551     for (TInt i = 0; i < iOnePageItemCnt; i++)
       
   552         {
       
   553         iItemRects.Append(TRect(TPoint(iContentRect.iTl.iX + iHorizontalMargin, 
       
   554                                        iContentRect.iTl.iY + (i+1)* iVerticalMargin + 
       
   555                                        i * iItemSize.iHeight) , 
       
   556                                        iItemSize));
       
   557         }        
       
   558 
   548 
   559     if (iNaviBtnShown)
   549     if (iNaviBtnShown)
   560         {
   550         {
   561         iScrollRect = TRect(TPoint(iContentRect.Width(), 0), 
   551 		TInt nWidthPager = 2 * iHorizontalMargin + iNaviSize.iWidth;
   562                             TSize(2*iHorizontalMargin + iNaviSize.iWidth, iContentRect.Height()));
   552 		TInt nXposPager = iContentRect.Width();
       
   553 		if (iAlign == CGraphicsContext::ERight)
       
   554 			{
       
   555 		    iContentRect.Move(nWidthPager, 0);
       
   556 			nXposPager = 0;
       
   557 			}
       
   558 		iScrollRect = TRect(TPoint(nXposPager, 0), TSize(nWidthPager, iContentRect.Height()));
   563         iPageUpRect = TRect(TPoint(iScrollRect.iTl.iX + iHorizontalMargin, 
   559         iPageUpRect = TRect(TPoint(iScrollRect.iTl.iX + iHorizontalMargin, 
   564                                    iScrollRect.iTl.iY + iVerticalMargin),
   560                                    iScrollRect.iTl.iY + iVerticalMargin),
   565                             iNaviSize);
   561                             iNaviSize);
   566                             
   562                             
   567         TPoint innerTl ( iPageUpRect.iTl.iX + ( iNaviSize.iWidth - iNaviInnerSize.iWidth ) /2,
   563         TPoint innerTl ( iPageUpRect.iTl.iX + ( iNaviSize.iWidth - iNaviInnerSize.iWidth ) /2,
   577         iPageDown->SizeChanged( iPageDownRect, TRect(innerTl, iNaviInnerSize), ETrue );
   573         iPageDown->SizeChanged( iPageDownRect, TRect(innerTl, iNaviInnerSize), ETrue );
   578         
   574         
   579         iPageInfoRect = TRect(TPoint(iScrollRect.iTl.iX, 
   575         iPageInfoRect = TRect(TPoint(iScrollRect.iTl.iX, 
   580                               iScrollRect.iTl.iY + iScrollRect.Height()/2 - iNaviSize.iHeight/2),
   576                               iScrollRect.iTl.iY + iScrollRect.Height()/2 - iNaviSize.iHeight/2),
   581                               iNaviSize);
   577                               iNaviSize);
   582 
   578         }
   583         ctrlRect.BoundingRect(iScrollRect);
   579     else
   584         }
   580     	{
   585 
   581 		iScrollRect = TRect(0, 0, 0, 0);
       
   582     	}
       
   583     
       
   584     iItemRects.Reset();
       
   585     for (TInt i = 0; i < iOnePageItemCnt; i++)
       
   586         {
       
   587         iItemRects.Append(TRect(TPoint(iContentRect.iTl.iX + iHorizontalMargin, 
       
   588 									   iContentRect.iTl.iY + (i + 1)* iVerticalMargin + 
       
   589                                        i * iItemSize.iHeight) , 
       
   590                                        iItemSize));
       
   591         }
       
   592     
       
   593     TRect ctrlRect = iContentRect;
       
   594     if (!iScrollRect.IsEmpty())
       
   595     	ctrlRect.BoundingRect(iScrollRect);
   586     SetRect(ctrlRect);
   596     SetRect(ctrlRect);
   587     UpdateNaviButtonStates();
   597     UpdateNaviButtonStates();
   588     }
   598     }
   589 
   599 
   590 EXPORT_C void CFepLayoutScrollableList::HandleControlEvent(TInt aEventType, 
   600 EXPORT_C void CFepLayoutScrollableList::HandleControlEvent(TInt aEventType,