textinput/peninputcommonctrls/src/peninputselectionlist/peninputscrollablelist.cpp
branchRCL_3
changeset 19 ac7e4d1d9209
parent 12 5e18d8c489d6
equal deleted inserted replaced
18:b1ea1642412e 19:ac7e4d1d9209
    34 const TInt KInvalidResId = -1;
    34 const TInt KInvalidResId = -1;
    35 const TInt KInvalidBmp = -1;
    35 const TInt KInvalidBmp = -1;
    36 
    36 
    37 
    37 
    38 const TInt KDisplayTextLen = KMaxItemTextLength + KAknBidiExtraSpacePerLine;
    38 const TInt KDisplayTextLen = KMaxItemTextLength + KAknBidiExtraSpacePerLine;
       
    39 
       
    40 const TInt KTextRectMargin = 4;
    39 
    41 
    40 EXPORT_C CFepLayoutScrollableList* CFepLayoutScrollableList::NewL(CFepUiLayout* aUiLayout,
    42 EXPORT_C CFepLayoutScrollableList* CFepLayoutScrollableList::NewL(CFepUiLayout* aUiLayout,
    41                                                                   TInt aControlId,
    43                                                                   TInt aControlId,
    42                                                                   TSize aItemSize,
    44                                                                   TSize aItemSize,
    43                                                                   TInt aHorizontalMargin,
    45                                                                   TInt aHorizontalMargin,
   498 	else
   500 	else
   499 	    {
   501 	    {
   500         AknBidiTextUtils::ConvertToVisualAndClip(item->iText, buf, *iFont,
   502         AknBidiTextUtils::ConvertToVisualAndClip(item->iText, buf, *iFont,
   501                                          itemRect.Width(), itemRect.Width());
   503                                          itemRect.Width(), itemRect.Width());
   502 	    }
   504 	    }
       
   505     
       
   506 	if ( itemRect.Height() - font->FontMaxHeight() < KTextRectMargin )
       
   507     	{
       
   508 	    // Make sure the height of the area for drawing text is larger than 
       
   509 	    // the max height of font by 4 pixels at least.
       
   510 	    // The piece of code is used to avoid clipping some characters, like 'g'.
       
   511         itemRect.SetHeight( font->FontMaxHeight() + KTextRectMargin );
       
   512     	}
   503 	gc->DrawText(buf, itemRect, baseLine, iAlign);
   513 	gc->DrawText(buf, itemRect, baseLine, iAlign);
   504 	gc->DiscardFont();
   514 	gc->DiscardFont();
   505     }
   515     }
   506 
   516 
   507 EXPORT_C void CFepLayoutScrollableList::ConstructL()
   517 EXPORT_C void CFepLayoutScrollableList::ConstructL()
   606     UpdateNaviButtonStates();
   616     UpdateNaviButtonStates();
   607     }
   617     }
   608 
   618 
   609 EXPORT_C void CFepLayoutScrollableList::HandleControlEvent(TInt aEventType, 
   619 EXPORT_C void CFepLayoutScrollableList::HandleControlEvent(TInt aEventType, 
   610                                                   CFepUiBaseCtrl* aCtrl,
   620                                                   CFepUiBaseCtrl* aCtrl,
   611                                                   const TDesC& aEventData)
   621                                                   const TDesC& /*aEventData*/)
   612     {
   622     {
   613     if( aEventType ==  EEventButtonUp )
   623     if( aEventType ==  EEventButtonUp )
   614         {
   624         {
   615         if( aCtrl == iPageUp )
   625         if( aCtrl == iPageUp )
   616             {
   626             {