Problem with save

General TRichView support forum. Please post your questions here
Post Reply
l1pton17
Posts: 6
Joined: Mon Aug 15, 2011 9:41 am

Problem with save

Post by l1pton17 »

Здравствуйте.
У меня в редакторе несколько вложенных друг в друга RichEdit. И когда я сохраняю с помощью SaveRvf , содержимое всех richedit-ов, кроме того, к которому я применяю сохранение, стирается, хотя SaveControlsBody стоит в true.
Приведу скрин строения программы:
Image
l1pton17
Posts: 6
Joined: Mon Aug 15, 2011 9:41 am

Post by l1pton17 »

Hello
I'm the editor several nested RichEdit. And when I keep using SaveRvf, the contents of all richedit-s, in addition to which I apply the retention, blurred, although SaveControlsBody stands true.
l1pton17
Posts: 6
Joined: Mon Aug 15, 2011 9:41 am

Post by l1pton17 »

How to access the content loaded SubRVF?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Just like a normal TRichView.
If you want to get all the content, use SaveRVFToStream. If you need it item by item, items are numbered from 0 to rv.ItemCount-1, a type of item is returned by rv.GetItemStyle, then use methods specific for each type.
l1pton17
Posts: 6
Joined: Mon Aug 15, 2011 9:41 am

Post by l1pton17 »

Например, я знаю, что в ItemNo RichView хранится SubRichViewEdit. И хочу получить содержимое этого SubRichViewEdit. Как это сделать?

For example, I know that ItemNo RichView stored SubRichViewEdit. And I want to get the contents of this SubRichViewEdit. How do I do?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

To get a content into what? TMemoryStream?

Получить содержимое в виде чего? Записанное в формате RVF в TMemoryStream подойдет?
l1pton17
Posts: 6
Joined: Mon Aug 15, 2011 9:41 am

Post by l1pton17 »

В качестве RVF вприницпе подходит. Вообще, мне нужно в качестве RichViewEdit, чтобы я имел доступ к ItemCount, GetItemStyle и прочее. Мой парсер перевода в bbCode работает именно с RichView.

As RVF vprinitspe fit. Actually, I need as RichViewEdit, so I had access to ItemCount, GetItemStyle and so on. My translation of the parser to BBcode work with RichViewEdit.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you have ItemNo (and the editor is in the main document, not in a table cell) use RichViewEdit.GetControlInfo(ItemNo, ...).
Then typecast Actrl to TRichViewEdit.
l1pton17
Posts: 6
Joined: Mon Aug 15, 2011 9:41 am

Post by l1pton17 »

Теперь возникает проблема в RVStyle. Если изменить в созданом SubRichEdit'e изменить стиль(например, сделать буквы жирными), то при загрузке этого RVF появляется ошибка: "Error in reading RVF subdocument".
Возможно, что это из-за того, что в классе SubRichViewEdit создаётся отдельный RVStyle, а не наследуются от главного RichView.

Now there is a problem in RVStyle. If the change in the creation of SubRichEdit'e change the style (for example, do the letters in bold), then load the RVF error: "Error in reading RVF subdocument".
It is possible that this is due to the fact that the class is a separate SubRichViewEdit RVStyle, and are not inherited from the main RichView.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, TSubRichViewEdit creates and uses its own TRVStyle, that is not connected with TRVStyle of the main document.
Not sure about the reason of this error, though. If you can create a simple projects and send it to me, I'll see what's wrong.
Post Reply