Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 10:47, 9 April 2008.

Clipping longText to Fit Screen

From Forum Nokia Wiki

Sometimes display text will be so long that it goes out of screen,in such case we can use ClipToFit() method to show ".." of the text.

Here, is the code to do so,

const CFont* myFont = iEikonEnv->DenseFont();
TBuf<100> buffer;
TInt aMaxWidthInPixels; //depending on your screen dimensions use this, for 176x208
                        //I use 100.
buffer.Copy(_L("BackStreet Boys Music tracks"));
AknTextUtils::ClipToFit(buffer,*myFont, aMaxWidthInPixels, AknTextUtils::EClipFromEnd, 
KDefaultClipWidth,_L("..."));

Now use this "buffer" in your Drawtext() method.

 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX