556 aViewIsDimmed, |
497 aViewIsDimmed, |
557 aItemIsSelected ) ) |
498 aItemIsSelected ) ) |
558 } |
499 } |
559 |
500 |
560 // ----------------------------------------------------------------------------- |
501 // ----------------------------------------------------------------------------- |
561 // CESMRNcsListItemDrawer::SetLayoutManager |
|
562 // ----------------------------------------------------------------------------- |
|
563 // |
|
564 void CESMRNcsListItemDrawer::SetLayoutManager(CESMRLayoutManager* aLayout) |
|
565 { |
|
566 FUNC_LOG; |
|
567 iLayout = aLayout; |
|
568 } |
|
569 |
|
570 // ----------------------------------------------------------------------------- |
|
571 // CESMRNcsListItemDrawer::DoDrawActualItemL |
502 // CESMRNcsListItemDrawer::DoDrawActualItemL |
572 // ----------------------------------------------------------------------------- |
503 // ----------------------------------------------------------------------------- |
573 // |
504 // |
574 void CESMRNcsListItemDrawer::DoDrawActualItemL( TInt aItemIndex, |
505 void CESMRNcsListItemDrawer::DoDrawActualItemL( TInt aItemIndex, |
575 const TRect& aActualItemRect, TBool aItemIsCurrent, |
506 const TRect& aActualItemRect, TBool aItemIsCurrent, |
576 TBool /*aViewIsEmphasized*/, TBool /*aViewIsDimmed*/, |
507 TBool /*aViewIsEmphasized*/, TBool /*aViewIsDimmed*/, |
577 TBool /*aItemIsSelected*/ ) const |
508 TBool /*aItemIsSelected*/ ) const |
578 { |
509 { |
579 FUNC_LOG; |
510 FUNC_LOG; |
580 // Get reference to curren popup cls item list. |
511 DrawPopUpBackGroundL( aActualItemRect ); |
581 const RPointerArray<CESMRClsItem>& clsItemArray = iListBox.CurrentPopupClsItemsArray(); |
512 |
582 TInt rmluPosition = iListBox.RMLUItemPosition(); |
513 // Draw the selector if current item is the focused one |
583 |
514 if( aItemIsCurrent ) |
584 // Sets all the attributes, like font, text color and background color. |
515 { |
585 const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); |
516 DrawPopUpSelectorL( aActualItemRect ); |
586 iGc->UseFont(font); |
517 } |
587 |
518 |
588 // We have to draw the item in layered fashion in order to do the skin |
519 DrawPopUpTextL( aItemIndex, aActualItemRect ); |
589 // First clear the backround by drawing a solid rect. |
520 } |
|
521 |
|
522 // ----------------------------------------------------------------------------- |
|
523 // CESMRNcsListItemDrawer::DrawPopUpBackGroundL |
|
524 // ----------------------------------------------------------------------------- |
|
525 // |
|
526 void CESMRNcsListItemDrawer::DrawPopUpBackGroundL( |
|
527 const TRect& aActualItemRect ) const |
|
528 { |
590 iGc->SetPenColor( KGrayBackground ); |
529 iGc->SetPenColor( KGrayBackground ); |
591 iGc->SetBrushColor( KGrayBackground ); |
530 iGc->SetBrushColor( KGrayBackground ); |
592 iGc->SetPenStyle(CGraphicsContext::ESolidPen); |
531 |
593 iGc->SetBrushStyle(CGraphicsContext::ESolidBrush); |
532 iGc->SetPenStyle( CGraphicsContext::ESolidPen ); |
594 |
533 iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); |
595 // Now draw the highlight |
534 |
596 if( aItemIsCurrent ) |
535 iGc->DrawRect( aActualItemRect ); |
597 { |
536 } |
598 if (iLayout) |
537 |
599 { |
538 // ----------------------------------------------------------------------------- |
600 CFbsBitmap* selector = NULL; |
539 // CESMRNcsListItemDrawer::DrawPopUpSelectorL |
601 CFbsBitmap* selectorMask = NULL; |
540 // ----------------------------------------------------------------------------- |
602 |
541 // |
603 // highlight bitmap target rect: |
542 void CESMRNcsListItemDrawer::DrawPopUpSelectorL( |
604 TRect rect( aActualItemRect ); |
543 const TRect& aActualItemRect ) const |
605 |
544 { |
606 TSize corner(KEdge, KEdge); |
545 CFbsBitmap* selector = NULL; |
607 iLayout->GetSkinBasedBitmap( |
546 CFbsBitmap* selectorMask = NULL; |
608 KAknsIIDQgnFsListCornerTl, selector, selectorMask, corner ); |
547 |
609 |
548 // Highlight bitmap target rect: |
610 //adjust selector size for if scrollbar is on screen |
549 TRect rect( aActualItemRect ); |
611 if (iListBox.ScrollBarFrame()->ScrollBarVisibility(CEikScrollBar::EVertical) == |
550 |
612 CEikScrollBarFrame::EOn) |
551 TSize corner( KEdge, KEdge ); |
613 { |
552 NMRBitmapManager::GetSkinBasedBitmap( |
614 rect.SetWidth( (rect.Width() - KScrollbarWidth) ); |
553 NMRBitmapManager::EMRBitmapListTopLeft, |
615 } |
554 selector, selectorMask, corner ); |
616 |
555 |
617 if( selector && selectorMask) |
556 // Adjust selector size if scrollbar is present |
618 { |
557 if ( iListBox.ScrollBarFrame()-> |
619 //corner TL |
558 ScrollBarVisibility( CEikScrollBar::EVertical ) == |
620 iGc->BitBltMasked( |
559 CEikScrollBarFrame::EOn ) |
621 rect.iTl, selector, corner, selectorMask, EFalse ); |
560 { |
622 |
561 TInt scrollBarWidth = |
623 //side L |
562 iListBox.ScrollBarFrame()->VerticalScrollBar()->Rect().Width(); |
624 TSize side(KEdge, (rect.Height() - 2 * KEdge) ); |
563 rect.SetWidth( ( rect.Width() - scrollBarWidth ) ); |
625 iLayout->GetSkinBasedBitmap( |
564 } |
626 KAknsIIDQgnFsListSideL, selector, selectorMask, side ); |
565 |
627 iGc->BitBltMasked( TPoint(rect.iTl.iX, rect.iTl.iY + KEdge), |
566 if( selector && selectorMask ) |
628 selector, side, selectorMask, EFalse ); |
567 { |
629 |
568 //corner TL |
630 //corner BL |
569 iGc->BitBltMasked( |
631 iLayout->GetSkinBasedBitmap( |
570 rect.iTl, selector, corner, selectorMask, EFalse ); |
632 KAknsIIDQgnFsListCornerBl, selector, selectorMask, corner ); |
571 |
633 iGc->BitBltMasked( |
572 //side L |
634 TPoint(rect.iTl.iX, rect.iTl.iY + KEdge + side.iHeight), |
573 TSize side( KEdge, ( rect.Height() - 2 * KEdge ) ); |
635 selector, corner, selectorMask, EFalse ); |
574 NMRBitmapManager::GetSkinBasedBitmap( |
636 |
575 NMRBitmapManager::EMRBitmapListLeft, |
637 //top |
576 selector, selectorMask, side ); |
638 TSize top( (rect.Width() - 2 * KEdge) , KEdge); |
577 iGc->BitBltMasked( TPoint(rect.iTl.iX, rect.iTl.iY + KEdge ), |
639 iLayout->GetSkinBasedBitmap( |
578 selector, side, selectorMask, EFalse ); |
640 KAknsIIDQgnFsListSideT, selector, selectorMask, top ); |
579 |
641 iGc->BitBltMasked( TPoint(rect.iTl.iX + KEdge, rect.iTl.iY), |
580 //corner BL |
642 selector, top, selectorMask, EFalse ); |
581 NMRBitmapManager::GetSkinBasedBitmap( |
643 |
582 NMRBitmapManager::EMRBitmapListBottomLeft, |
644 //center |
583 selector, selectorMask, corner ); |
645 TSize center( top.iWidth, side.iHeight); |
584 iGc->BitBltMasked( |
646 iLayout->GetSkinBasedBitmap( |
585 TPoint(rect.iTl.iX, rect.iTl.iY + KEdge + side.iHeight ), |
647 KAknsIIDQgnFsListCenter, selector, selectorMask, center ); |
586 selector, corner, selectorMask, EFalse ); |
648 iGc->BitBltMasked( |
587 |
649 TPoint(rect.iTl.iX + KEdge, rect.iTl.iY + KEdge), |
588 //top |
650 selector, center, selectorMask, EFalse ); |
589 TSize top( ( rect.Width() - 2 * KEdge ) , KEdge ); |
651 |
590 NMRBitmapManager::GetSkinBasedBitmap( |
652 //bottom |
591 NMRBitmapManager::EMRBitmapListTop, |
653 iLayout->GetSkinBasedBitmap( |
592 selector, selectorMask, top ); |
654 KAknsIIDQgnFsListSideB, selector, selectorMask, top ); |
593 iGc->BitBltMasked( TPoint( rect.iTl.iX + KEdge, rect.iTl.iY ), |
655 iGc->BitBltMasked( |
594 selector, top, selectorMask, EFalse ); |
656 TPoint(rect.iTl.iX + KEdge, rect.iTl.iY + side.iHeight + KEdge), |
595 |
657 selector, top, selectorMask, EFalse ); |
596 //center |
658 |
597 TSize center( top.iWidth, side.iHeight ); |
659 //corner TR |
598 NMRBitmapManager::GetSkinBasedBitmap( |
660 iLayout->GetSkinBasedBitmap( |
599 NMRBitmapManager::EMRBitmapListCenter, |
661 KAknsIIDQgnFsListCornerTr, selector, selectorMask, corner ); |
600 selector, selectorMask, center ); |
662 iGc->BitBltMasked( |
601 iGc->BitBltMasked( |
663 TPoint(rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY), |
602 TPoint( rect.iTl.iX + KEdge, rect.iTl.iY + KEdge ), |
664 selector, corner, selectorMask, EFalse ); |
603 selector, center, selectorMask, EFalse ); |
665 |
604 |
666 //side R |
605 //bottom |
667 iLayout->GetSkinBasedBitmap( |
606 NMRBitmapManager::GetSkinBasedBitmap( |
668 KAknsIIDQgnFsListSideR, selector, selectorMask, side ); |
607 NMRBitmapManager::EMRBitmapListBottom, |
669 iGc->BitBltMasked( |
608 selector, selectorMask, top ); |
670 TPoint(rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY + KEdge), |
609 iGc->BitBltMasked( |
671 selector, side, selectorMask, EFalse ); |
610 TPoint( rect.iTl.iX + KEdge, rect.iTl.iY + side.iHeight + KEdge ), |
672 |
611 selector, top, selectorMask, EFalse ); |
673 //corner Br |
612 |
674 iLayout->GetSkinBasedBitmap( |
613 //corner TR |
675 KAknsIIDQgnFsListCornerBr, selector, selectorMask, corner ); |
614 NMRBitmapManager::GetSkinBasedBitmap( |
676 iGc->BitBltMasked( |
615 NMRBitmapManager::EMRBitmapListTopRight, |
677 TPoint(rect.iTl.iX + KEdge + top.iWidth, |
616 selector, selectorMask, corner ); |
678 rect.iTl.iY + KEdge + side.iHeight), |
617 iGc->BitBltMasked( |
679 selector, corner, selectorMask, EFalse ); |
618 TPoint( rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY ), |
680 } |
619 selector, corner, selectorMask, EFalse ); |
681 else |
620 |
682 { |
621 //side R |
|
622 NMRBitmapManager::GetSkinBasedBitmap( |
|
623 NMRBitmapManager::EMRBitmapListRight, |
|
624 selector, selectorMask, side ); |
|
625 |
|
626 iGc->BitBltMasked( |
|
627 TPoint( rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY + KEdge ), |
|
628 selector, side, selectorMask, EFalse ); |
|
629 |
|
630 //corner Br |
|
631 NMRBitmapManager::GetSkinBasedBitmap( |
|
632 NMRBitmapManager::EMRBitmapListBottomRight, |
|
633 selector, selectorMask, corner ); |
|
634 iGc->BitBltMasked( |
|
635 TPoint( rect.iTl.iX + KEdge + top.iWidth, |
|
636 rect.iTl.iY + KEdge + side.iHeight ), |
|
637 selector, corner, selectorMask, EFalse ); |
|
638 } |
|
639 else |
|
640 { |
683 iGc->SetBrushColor( KSelectorFallbackColor ); |
641 iGc->SetBrushColor( KSelectorFallbackColor ); |
684 } |
642 } |
685 |
643 delete selector; |
686 delete selector; |
644 delete selectorMask; |
687 delete selectorMask; |
645 } |
688 } |
646 |
689 else |
647 // ----------------------------------------------------------------------------- |
690 { |
648 // CESMRNcsListItemDrawer::DrawPopUpTextL |
691 iGc->SetBrushColor( KSelectorFallbackColor ); |
649 // ----------------------------------------------------------------------------- |
692 } |
650 // |
693 } |
651 void CESMRNcsListItemDrawer::DrawPopUpTextL( |
694 else |
652 TInt aItemIndex, |
695 { |
653 const TRect& aActualItemRect ) const |
696 iGc->DrawRect(aActualItemRect); |
654 { |
697 } |
655 // Get reference to curren popup cls item list. |
698 |
656 const RPointerArray<CESMRClsItem>& clsItemArray = |
699 if(aItemIsCurrent) |
657 iListBox.CurrentPopupClsItemsArray(); |
700 { |
658 TInt rmluPosition = iListBox.RMLUItemPosition(); |
701 iGc->SetPenColor( KWhite ); |
659 |
|
660 iGc->SetPenColor( NMRColorManager::Color( |
|
661 NMRColorManager::EMRMainAreaTextColor ) ); |
|
662 |
|
663 // Sets all the attributes, like font, text color and background color. |
|
664 const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); |
|
665 iGc->UseFont( font ); |
|
666 |
|
667 iGc->SetPenStyle(CGraphicsContext::ESolidPen); |
|
668 iGc->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
669 TInt topToBaseline = ( aActualItemRect.Height() - font->HeightInPixels() ) / 2 |
|
670 + font->AscentInPixels(); |
|
671 |
|
672 TPtrC itemText( iListBox.Model()->ItemText( aItemIndex ) ); |
|
673 |
|
674 // Construct bidirectional text object |
|
675 TBidiText* bidiText = TBidiText::NewL( itemText, 1 ); |
|
676 CleanupStack::PushL( bidiText ); |
|
677 bidiText->WrapText( aActualItemRect.Width(), *font, NULL ); |
|
678 TPoint leftBase = aActualItemRect.iTl + TPoint( 0, topToBaseline ); |
|
679 leftBase.iX += KListBoxDrawMargin; |
|
680 |
|
681 // check if we are drawing remote lookup item or contact match |
|
682 if ( rmluPosition == aItemIndex ) |
|
683 { |
|
684 iGc->SetUnderlineStyle( EUnderlineOff ); |
|
685 bidiText->DrawText( *iGc, leftBase ); |
702 } |
686 } |
703 else |
687 else |
704 { |
688 { |
705 iGc->SetPenColor( KGraySelectable ); |
689 // if list has rmlu item change item index right |
706 } |
690 // if ( rmluPosition >= 0 ) |
707 |
691 // { |
708 iGc->SetPenStyle(CGraphicsContext::ESolidPen); |
692 // --aItemIndex; |
709 iGc->SetBrushStyle(CGraphicsContext::ENullBrush); |
693 // aItemIndex = Max( 0, aItemIndex ); |
710 TInt topToBaseline = ( aActualItemRect.Height() - font->HeightInPixels() ) / 2 |
694 // } |
711 + font->AscentInPixels(); |
695 |
712 |
696 TPtrC email = clsItemArray[aItemIndex]->EmailAddress().Ptr(); |
713 TPtrC itemText = iListBox.Model()->ItemText( aItemIndex ); |
697 // change color to gray if match doesn't have email address. |
714 |
698 if ( clsItemArray[aItemIndex]->EmailAddress().Compare( KNullDesC ) == 0 ) |
715 // Construct bidirectional text object |
699 { |
716 TBidiText* bidiText = TBidiText::NewL( itemText, 1 ); |
|
717 CleanupStack::PushL( bidiText ); |
|
718 bidiText->WrapText( aActualItemRect.Width(), *font, NULL ); |
|
719 TPoint leftBase = aActualItemRect.iTl + TPoint( 0, topToBaseline ); |
|
720 leftBase.iX += KListBoxDrawMargin; |
|
721 |
|
722 // check if we are drawing remote lookup item or contact match |
|
723 if ( rmluPosition == aItemIndex ) |
|
724 { |
|
725 iGc->SetUnderlineStyle( EUnderlineOff ); |
|
726 bidiText->DrawText( *iGc, leftBase ); |
|
727 } |
|
728 else |
|
729 { |
|
730 // if list has rmlu item change item index right |
|
731 if ( rmluPosition >= 0 ) |
|
732 { |
|
733 --aItemIndex; |
|
734 aItemIndex = Max( 0, aItemIndex ); |
|
735 } |
|
736 |
|
737 // change color to gray if match doesn't have email address. |
|
738 if ( clsItemArray[aItemIndex]->EmailAddress().Compare( KNullDesC ) == 0 ) |
|
739 { |
|
740 iGc->SetPenColor( KGrayNoEmail ); |
700 iGc->SetPenColor( KGrayNoEmail ); |
741 iGc->SetBrushColor( KGrayNoEmail ); |
701 iGc->SetBrushColor( KGrayNoEmail ); |
742 } |
702 } |
743 |
703 |
744 // We know the text contains RTL script if the display string is not just |
704 // TO-DO: For now, we support underlining the matching part only if the |
745 // truncated version of the original string. |
705 // text is written completely with left-to-right script |
746 TPtrC dispText = bidiText->DisplayText(); |
706 |
747 TInt compLength = dispText.Length() - 1; // -1 to omit the truncation character |
707 // We know the text contains RTL script if the display string is not just |
748 TBool textContainsRtl = |
708 // truncated version of the original string. |
|
709 TPtrC dispText = bidiText->DisplayText(); |
|
710 TInt compLength = dispText.Length() - 1; // -1 to omit the truncation character |
|
711 TBool textContainsRtl = |
749 ( itemText.Left(compLength) != dispText.Left(compLength) ); |
712 ( itemText.Left(compLength) != dispText.Left(compLength) ); |
750 |
713 |
751 const RArray<TPsMatchLocation>& underlines = clsItemArray[aItemIndex]->Highlights(); |
714 const RArray<TPsMatchLocation>& underlines = clsItemArray[aItemIndex]->Highlights(); |
752 |
715 |
753 if ( underlines.Count() > 0 && !textContainsRtl ) |
716 if ( underlines.Count() > 0 && !textContainsRtl ) |
754 { |
717 { |
755 TInt i = 0; |
718 TInt i = 0; |
756 TBool partsLeft = ETrue; |
719 TBool partsLeft = ETrue; |
757 TInt currentTextStart = 0; |
720 TInt currentTextStart = 0; |
758 TInt currentTextLength = 0; |
721 TInt currentTextLength = 0; |
759 |
722 |
760 while ( partsLeft ) |
723 while ( partsLeft ) |
761 { |
724 { |
762 if ( currentTextStart < underlines[i].index ) |
725 if ( currentTextStart < underlines[i].index ) |
763 { |
726 { |
764 // draw letters to the start of the underlined part |
727 // draw letters to the start of the underlined part |
765 currentTextLength = underlines[i].index - currentTextStart; |
728 currentTextLength = underlines[i].index - currentTextStart; |
766 DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, |
729 DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, |
767 EFalse, topToBaseline ); |
730 EFalse, topToBaseline ); |
768 } |
731 } |
769 else if ( currentTextStart == underlines[i].index ) |
732 else if ( currentTextStart == underlines[i].index ) |
770 { |
733 { |
771 // draw underlined letters |
734 // draw underlined letters |
772 currentTextLength = underlines[i].length; |
735 currentTextLength = underlines[i].length; |
773 |
736 |
774 DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, |
737 DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, |
775 ETrue, topToBaseline ); |
738 ETrue, topToBaseline ); |
776 i++; |
739 i++; |
777 } |
740 } |
778 else |
741 else |
779 { |
742 { |
780 // This is here, because PCS Engine might give you duplicate match entries, |
743 // This is here, because PCS Engine might give you duplicate match entries, |
781 // in this case we're not advancing text but we'll skip that match |
744 // in this case we're not advancing text but we'll skip that match |
782 currentTextLength = 0; |
745 currentTextLength = 0; |
783 i++; |
746 i++; |
784 } |
747 } |
785 // update text start point |
748 // update text start point |
786 currentTextStart += currentTextLength; |
749 currentTextStart += currentTextLength; |
787 |
750 |
788 if ( i >= underlines.Count() ) |
751 if ( i >= underlines.Count() ) |
789 { |
752 { |
790 partsLeft = EFalse; |
753 partsLeft = EFalse; |
791 // draw rest of the letters, if there are any after the last underlined part |
754 // draw rest of the letters, if there are any after the last underlined part |
792 if ( currentTextStart < itemText.Length() ) |
755 if ( currentTextStart < itemText.Length() ) |
793 { |
756 { |
794 currentTextLength = itemText.Length() - currentTextStart; |
757 currentTextLength = itemText.Length() - currentTextStart; |
795 DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, |
758 DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, |
796 EFalse, topToBaseline ); |
759 EFalse, topToBaseline ); |
797 } |
760 } |
798 } |
761 } |
799 } |
762 } |
800 } |
763 } |
801 else |
764 else |
802 { |
765 { |
803 iGc->SetUnderlineStyle( EUnderlineOff ); |
766 iGc->SetUnderlineStyle( EUnderlineOff ); |
804 bidiText->DrawText( *iGc, leftBase ); |
767 bidiText->DrawText( *iGc, leftBase ); |
805 } |
768 } |
806 } |
769 } |
807 CleanupStack::PopAndDestroy( bidiText ); |
770 CleanupStack::PopAndDestroy( bidiText ); |
808 } |
771 } |
809 |
772 |
810 // ----------------------------------------------------------------------------- |
773 // ----------------------------------------------------------------------------- |
811 // CESMRNcsListItemDrawer::DrawPartOfItem |
774 // CESMRNcsListItemDrawer::DrawPartOfItem |
812 // ----------------------------------------------------------------------------- |
775 // ----------------------------------------------------------------------------- |
813 void CESMRNcsListItemDrawer::DrawPartOfItem( const TRect& aItemRect, const CFont& aFont, |
776 void CESMRNcsListItemDrawer::DrawPartOfItem( const TRect& aItemRect, const CFont& aFont, |
814 TInt aStartPos, TInt aLength, const TDesC& aDes, |
777 TInt aStartPos, TInt aLength, const TDesC& aDes, |
815 TBool aUnderlined, TInt aBaselineOffsetFromTop ) const |
778 TBool aUnderlined, TInt aBaselineOffsetFromTop ) const |
816 { |
779 { |
817 FUNC_LOG; |
780 FUNC_LOG; |
818 if( aUnderlined ) |
781 if( aUnderlined ) |
819 { |
782 { |
820 iGc->SetUnderlineStyle( EUnderlineOn ); |
783 iGc->SetUnderlineStyle( EUnderlineOn ); |
821 } |
|
822 else |
|
823 { |
|
824 iGc->SetUnderlineStyle( EUnderlineOff ); |
|
825 } |
|
826 TRect currentTextRect( aItemRect ); |
|
827 TInt pixels = aFont.TextWidthInPixels( aDes.Left( aStartPos ) ); |
|
828 currentTextRect.iTl.iX = currentTextRect.iTl.iX + pixels + KListBoxDrawMargin; |
|
829 |
|
830 //adjust selector size for if scrollbar is on screen |
|
831 if (iListBox.ScrollBarFrame()->ScrollBarVisibility(CEikScrollBar::EVertical) == |
|
832 CEikScrollBarFrame::EOn) |
|
833 { |
|
834 currentTextRect.iBr.iX = currentTextRect.iBr.iX - KListBoxDrawMargin - KScrollbarWidth; |
|
835 } |
784 } |
836 else |
785 else |
837 { |
786 { |
|
787 iGc->SetUnderlineStyle( EUnderlineOff ); |
|
788 } |
|
789 TRect currentTextRect( aItemRect ); |
|
790 TInt pixels = aFont.TextWidthInPixels( aDes.Left( aStartPos ) ); |
|
791 currentTextRect.iTl.iX = currentTextRect.iTl.iX + pixels + KListBoxDrawMargin; |
|
792 |
|
793 // adjust selector size for if scrollbar is on screen |
|
794 if ( iListBox.ScrollBarFrame()-> |
|
795 ScrollBarVisibility( CEikScrollBar::EVertical ) == |
|
796 CEikScrollBarFrame::EOn ) |
|
797 { |
|
798 TInt scrollBarWidth = |
|
799 iListBox.ScrollBarFrame()->VerticalScrollBar()->Rect().Width(); |
|
800 currentTextRect.iBr.iX = |
|
801 currentTextRect.iBr.iX - KListBoxDrawMargin - scrollBarWidth; |
|
802 } |
|
803 else |
|
804 { |
838 currentTextRect.iBr.iX = currentTextRect.iBr.iX - KListBoxDrawMargin; |
805 currentTextRect.iBr.iX = currentTextRect.iBr.iX - KListBoxDrawMargin; |
839 } |
806 } |
840 |
807 |
841 iGc->DrawText( aDes.Mid( aStartPos, aLength ), currentTextRect, aBaselineOffsetFromTop ); |
808 iGc->DrawText( aDes.Mid( aStartPos, aLength ), currentTextRect, aBaselineOffsetFromTop ); |
842 |
809 |
843 } |
810 } |
844 |
|
845 |
|
846 |
811 |
847 // End of File |
812 // End of File |
848 |
|