Page 1 of 1

reset list numbering

Posted: Sun Mar 16, 2014 5:20 pm
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?

Posted: Mon Mar 17, 2014 11:13 am
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?

Posted: Thu Mar 20, 2014 3:37 am
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?