497 TInt aBaseline, |
497 TInt aBaseline, |
498 TRect& aRect) const |
498 TRect& aRect) const |
499 { |
499 { |
500 TRgb color = KRgbBlack; |
500 TRgb color = KRgbBlack; |
501 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, |
501 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, |
502 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8 ); |
502 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG51 ); |
503 aGc.SetPenColor( color ); |
503 aGc.SetPenColor( color ); |
504 // This function shifts the RHS of aRect left by the width of the text drawn. |
504 // This function shifts the RHS of aRect left by the width of the text drawn. |
505 // It temporarily limits the draw rectangle to the text width to prevent flicker. |
505 // It temporarily limits the draw rectangle to the text width to prevent flicker. |
506 TPtr buf( TranslatedText( aText ) ); |
506 TPtr buf( TranslatedText( aText ) ); |
507 |
507 |
521 TRect& aRect ) const |
521 TRect& aRect ) const |
522 { |
522 { |
523 TRgb color; |
523 TRgb color; |
524 color = KRgbBlack; |
524 color = KRgbBlack; |
525 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, |
525 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, |
526 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8 ); |
526 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG51 ); |
527 aGc.SetPenColor( color ); |
527 aGc.SetPenColor( color ); |
528 TPtr buf( TranslatedText( aText ) ); |
528 TPtr buf( TranslatedText( aText ) ); |
529 aGc.DrawText( buf, aRect, aBaseline, CGraphicsContext::ERight ); |
529 aGc.DrawText( buf, aRect, aBaseline, CGraphicsContext::ERight ); |
530 } |
530 } |
531 |
531 |
572 aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
572 aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
573 aGc.SetBrushColor( brushColor ); |
573 aGc.SetBrushColor( brushColor ); |
574 aGc.DrawRect( rect ); |
574 aGc.DrawRect( rect ); |
575 aGc.SetPenStyle( CGraphicsContext::ESolidPen ); |
575 aGc.SetPenStyle( CGraphicsContext::ESolidPen ); |
576 aGc.SetPenColor( penColor ); |
576 aGc.SetPenColor( penColor ); |
|
577 TInt selStart( iModel->LeftMark() ); |
577 TInt endPos( iModel->Length() - SelectionStart() ); |
578 TInt endPos( iModel->Length() - SelectionStart() ); |
578 TInt startPos( iModel->Length() - SelectionEnd() ); |
579 TInt startPos( iModel->Length() - SelectionEnd() ); |
579 TPtrC text( TranslatedText( iModel->Text( startPos, endPos - 1 ) ) ); |
580 TPtrC text( TranslatedText( iModel->Selection().Mid( startPos - selStart, |
580 aGc.DrawText( text, rect, baseline, CGraphicsContext::ELeft ); |
581 endPos - startPos ) ) ); |
|
582 aGc.DrawText( text, rect, baseline, CGraphicsContext::ERight ); |
581 } |
583 } |
582 |
584 |
583 TPtr TAknPhedViewLine::TranslatedText( const TDesC& aText ) const |
585 TPtr TAknPhedViewLine::TranslatedText( const TDesC& aText ) const |
584 { |
586 { |
585 TPtr buf( iModel->TranslationBuffer() ); |
587 TPtr buf( iModel->TranslationBuffer() ); |