diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-55165C57-0F32-5363-A2EC-E37B5B36B6E1.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-55165C57-0F32-5363-A2EC-E37B5B36B6E1.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,31 @@ + + + + + +How to set up the text view

The following code constructs a text view, first allocating and constructing all its parameters.

The view rectangle is the rectangle in which all text, cursors and labels will be displayed. It resides within the view window and can be smaller than it.

TRect iViewRect; // rectangle in which to view text +CTextLayout* iLayout; // text layout +CTextView* iTextView; // text view +CRichText* iRichText; // rich text document +// prerequisites for view - viewing rectangle +iViewRect=Rect(); // Construct view rectangle +// layout +iLayout=CTextLayout::NewL(iRichText,iViewRect.Width()); + // construct layout, giving width of view rectangle +// context and device +CWindowGc& gc=SystemGc(); // get graphics context +CBitmapDevice* device=(CBitmapDevice*) (gc.Device()); // device +// text view +iTextView=CTextView::NewL(iLayout, iViewRect, + device, + device, + &Window(), + &iCoeEnv->RootWin(), // window group, needed for cursor + &iCoeEnv->WsSession() + ); // new view
\ No newline at end of file