Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[CONNECT C++] How to move Caret to End of Run?

$
0
0

Given a TextNode that has as the first Paragraph:

ABYX~ \ ab<cr>

 

I want to set a Caret to the End of a Run so I can do this and get the "plain text":

wprintf(L"[%s]\n", textBlock->ToString(*runCaret, *endOfCurrentRun));

 

So I do this:

CaretPtr		endOfCurrentRun = runCaret->Clone();
endOfCurrentRun->MoveToNextRun();

and I get the <cr> included (The "length" is reported as 11). If I do this:

CaretPtr		endOfCurrentRun = runCaret->Clone();
endOfCurrentRun->MoveToNextRun();
endOfCurrentRun->MoveToPreviousCharacter();

 

I get "ABYZ~ \ ab". (The length is reported as 9) The ending "c' is left off.

So. how to set the "endOfCurrentRun" Caret to return the proper, complete string? I am interested in getting the Carets set properly, NOT the resulting string. I'm just using the string to verify the Caret positions..

 

Bruce


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>