trichview.com

trichview.support




Re: get paragraph text, select paragraph mode.


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/20/2003 22:47:16


Thank you, Anonymous :)


Some comments:

As you can see, this code uses a limited set of methods.

Item indices has range from 0 to ItemCount-1. If the i-th item starts a

paragraph, IsParaStart(i) returns True.

Using this methods, you can find a position of the beginning and the end of

paragraph and select it (see SelectPara_).

Copying is possible by selecting paragraph, saving it in a temporal stream

as RVF, then inserting at the end of another TRichView (see

CopyParaFromRVE2RVE).

When you copy all the paragraphs, cell Format for the destination TRichView.


The clicked paragraph can be selected in OnRVMouseUp event, as shown in the

code.


Suggestions:

- Code in StartPara uses I after exiting FOR. It's better to avoid such

things.

- In EndPara, I inside FOR cannot be equal to 0 (code can be simplified)

- RVERVMouseUp code can be implemented much more efficiently; it performs

double unnecessary work compensating each other: calculates the current

paragraph index by the current item (in GetCurrParaNo_), then performs

[almost] reverse calculations (in SelectPara_ --> GetParaStartItem_).






Powered by ABC Amber Outlook Express Converter