diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-1B58FBA8-4E2C-5A99-A4B7-D7475E1B8F96.dita --- a/Symbian3/PDK/Source/GUID-1B58FBA8-4E2C-5A99-A4B7-D7475E1B8F96.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-1B58FBA8-4E2C-5A99-A4B7-D7475E1B8F96.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,23 +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 + + + + + +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.

  • Resize the view rectangle (an instance of class TRect) by shrinking it by forty pixels in both directions.

  • Reset the view rectangle using CTextView::SetViewRect().

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.

  • To ensure that text wrapping is set, use CTextLayout::DisableWrapOverride(EFalse). By default, wrapping is set.

  • As the wrapping width is a global document characteristic, changes to it may be handled using CTextView::HandleGlobalChangeL().

// 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