diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-1B58FBA8-4E2C-5A99-A4B7-D7475E1B8F96.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-1B58FBA8-4E2C-5A99-A4B7-D7475E1B8F96.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,23 @@ + + + + + +How to use wrapping

After any operation which resizes the text + area, the wrapping width may need to be changed. The code in this section resets the view rectangle, and then resets the wrapping width accordingly.

iViewRect.Shrink(40,40); +iTextView->SetViewRect(iViewRect); +iTextView->HandleGlobalChangeL(); + // update formatting and draw the completely revamped view

The following code sets the wrapping width to be the width of the new view rectangle minus the total margin width, so that text wraps at the right hand edge of the view rectangle.

// Wrap text to new view rectangle +TInt labelsWidth,lineCursorWidth; +// Get both margin widths +iTextView->MarginWidths(labelsWidth,lineCursorWidth); +// New wrap width = new view rect width minus total margin width +iLayout->SetWrapWidth(iViewRect.Width()-(labelsWidth+lineCursorWidth)); +iLayout->DisableWrapOverride(EFalse); // Ensure wrapping on +iTextView->HandleGlobalChangeL();
\ No newline at end of file