trichview.com

trichview.support




Re: Three questions before I buy ...


Return to index


Author

Message

Sergey Tkachenko

Posted: 08/26/2004 15:53:12


> I have downloaded and played with the trial. Before I buy, I'd like to ask

> three questions:

>

> 1. In TRichView, is there a way to format text other than using a style?

> It seems a waste to have to create a style for every possible formatting

> combination that can occur. I mean: must I have a style with red text and

> an additional style with red bold text, just to be able to add red text

and

> red bold text to my document?


No, this is the only way.

But you do not need to create styles for each possible combinations - you

can create them when they are needed (and search for existing styles with

the same properties and reuse them if possible).

DeleteUnusedStyles method deletes all unused styles (except for styles

marked as Standard)

Actually, this is an efficient way to maintain text formatting. Any word

processor needs to store formatting somewhere. In TRichView (1) each unique

formatting is stored in a single object (providing that you reuse existing

styles) (2) you have a full control over formatting.


If you will use RichViewActions, they will do this work for you (see

http://www.trichview.com/resources/actions/)

If you want to create editor without RichViewActions, see the demo

Demos\Delphi\Editors\Editor 2\

One more demo: processing chat codes to make text bold, italic, etc:

http://www.trichview.com/support/files/chatcodes.zip


>

> 2. Still in TRichView, is there a way, other than the GetLineNo method, to

> tell quickly and easily how many lines (or possibly even paragraphs) there

> are in the document?


Paragraph count:


ParaCount := 0;

for i := 0 to rv.ItemCount-1 do

  if rv.IsParaStart(i) then

    inc(ParaCount);

This function does not count paragraphs in table (it counts table as one

paragraph).

Lines, unlike paragraphs, depend on wrapping - after resizing RichView

window there will be different number of lines.


>

> 3. Is there a way to delete paragraphs -without- auto updating the

document?

> In other words, a way to do multiple deletions and then format.


Use DeleteItems. A range of items to delete can be determined using

IsParaStart method.

Then finished, call Format method.



>

> Many thanks.

>

>





Powered by ABC Amber Outlook Express Converter