reset list numbering

General TRichView support forum. Please post your questions here
Post Reply
AlexKraft
Posts: 2
Joined: Sun Mar 16, 2014 4:06 pm

reset list numbering

Post by AlexKraft »

Hello!
Sorry for my bad English.
I have a problem with cleaning numbering squeaks in RichView.
RichView insert text in a numbered.

Code: Select all

ms:= TMemoryStream.Create;
s := GetRTF;
ms.Write(s[1], Length(s));
ms.Seek(0, soFromBeginning);
table.Cells[0,0].LoadRTFFromStream(ms);
RichView.AddItem('', table);
But if run this code a second time, the numbering of the text you want to continue numbering value early insertion. In a method RichViewEdit RemoveLists (False) which resets the numbering, but this method RichView component is missing. Can I reset the numbering of the list is the component RichView?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, I do not understand, do you want to continue numbering when inserting RTF for the second tome, or do you want to reset it?
AlexKraft
Posts: 2
Joined: Sun Mar 16, 2014 4:06 pm

Post by AlexKraft »

On the form, there are two components and TRichView TRichViewEdit.
In Trichvieschedit entering text using the numbered squeak, for example:
  • 1. words ...
    2. words ...
    3. words ...
    ...
    n. words ...
This text is sent to TRichView, here's the code:

Code: Select all

 
ms: = TMemoryStream.Create; 
try
  RichViewEdit.SaveRTFToStream(ms, False); 
  ms.Seek (0, soFromBeginning); 
  table.Cells[0,0].LoadRTFFromStream(ms); 
finally 
   ms.Free; 
end; 
RichView.AddItem('', table); 

Further repeated paste text using a numbered list and instead to get in TRichView two different numbered lists:
  • 1. words ...
    2. words ...
    3. words ...
    ...
    n. words ...
    ---------------
    1. words ...
    2. words ...
    3. words ...
    ...
    n. words ...
it turns continue numbering:
  • 1. words1 ...
    2. words1 ...
    3. words1 ...
    ...........
    4. words ...
    5. words ...
    6. words ...
I know there is a method in TRichViewEdit RichViewEdit.RemoveLists (False) which resets the numbering and allows her to start from the beginning.
But RichView is no such method, as you can reset the numbering RichView?
Post Reply