diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-530DBEB3-2379-5567-BB10-45D21D6FF80A.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-530DBEB3-2379-5567-BB10-45D21D6FF80A.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,16 @@ + + + + + +How to select text

A selection can range from a single character to the entire document. The following example code selects the first paragraph.

TInt pos=0; +TUint scanMask=CPlainText::EScanToUnitEnd; +iRichText->ScanParas(pos,scanMask); // get end pos of 1st para +// move cursor to end of para and select it +iTextView->SetDocPosL(pos,ETrue);
Note
  • The use of SetDocPosL() demonstrated above shows how text can be selected using the old cursor position as the anchor. An alternative method of selecting text is to use CTextView::SetSelectionL(). This function allows the user to specify the anchor as well as the cursor position.

\ No newline at end of file