×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    UK
    Posts
    31

    New line in DrawText

    My question is how to draw text that will be in two, or more lines?
    I have tried to manualy breake text using \n or \f but it did not worked. I got empty square printed instead of new line.
    This is what I have:

    const CFont* fontUsed = iEikonEnv->LegendFont();
    iOffScreenDisplayGc->UseFont( fontUsed );
    TRect box = Rect();
    box.SetRect(50,25,135,61);
    TInt baseline = box.Height() /2 + fontUsed->AscentInPixels()/2;
    iOffScreenDisplayGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
    iOffScreenDisplayGc->SetBrushColor(RGB_GRAY);
    iOffScreenDisplayGc->SetPenColor(RGB_YELLOW);
    TBuf<40> msg;
    if( iStage == 1 ) { msg.Copy(_L("Copying... choose place")); }
    if( iStage == 2 ) { msg.Copy(_L("Moving... choose place")); }
    if( iStage == 3 ) { msg.Copy(_L("left or right?")); }
    iOffScreenDisplayGc->DrawText( msg, box, baseline, CGraphicsContext::ECenter, 0 );

    in .h file is of course:
    CFbsBitGc* iOffScreenDisplayGc;

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    81
    i dont think you can get text in new line by using /n .
    Normally you have to use /n/r if you want to display text in rich edit control.
    By systemgc you have to set y position to get text in another line.

    Hope this will help.

    Sanjiv

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×