Protection of text and pictures.

General TRichView support forum. Please post your questions here
Post Reply
Marcer
Posts: 31
Joined: Mon Mar 23, 2009 1:54 pm

Protection of text and pictures.

Post by Marcer »

Hi,

I have a function that protect all the text in my RichView by assigning [rvprModifyProtect, rvprDeleteProtect, rvprSticking, rvprStickToTop] to every style in my RichView. Also, when my function detects a picture with « StyleNo = rvsPicture », I apply the following code :

Code: Select all

SetItemExtraIntProperty(iItm, rvepDeleteProtect, 1);
SetItemExtraIntProperty(iItm, rvepResizable, 0);
My problem is that I can insert text between my text and my picture.

Is there a way to prevent this behavior.

Thank you.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The simplest way to protect everything is assigning RichViewEdit.ReadOnly := True.

Also, you can protect paragraph (see Options property of paragraph style).

Or, to prevent inserting something between specific items, you can use OnCheckStickingItems event.
Marcer
Posts: 31
Joined: Mon Mar 23, 2009 1:54 pm

Post by Marcer »

Hello Sergey,

I'm currently implementing a functionality to protect the current selection. So « RichViewEdit.ReadOnly := True » and « paragraph style » are not solutions that I can consider.

On the other hand, OnCheckStickingItems is pretty much what I needed but there is a catch.

When I have two paragraph separated by a picture protected with rvprSticking and rvepDeleteProtect, OnCheckStickingItems is not fired when I write to the left or to the right of my picture, probably because of line feeds.

Do you have any recommendations to correct this problem?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

It's a bug. It will be fixed in the next update.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Fixed in v14.9.1 (available for registered users)
Post Reply