how to implement that user can protect they selected text?

General TRichView support forum. Please post your questions here
Post Reply
chuqingsheng
Posts: 38
Joined: Sat Nov 06, 2010 5:12 am

how to implement that user can protect they selected text?

Post by chuqingsheng »

I need such function:
User can select the text and to set those text can not be deleted (delete protected).


I search richview help doc, I know how to protect the item by itemNo, but could not found how to do with user selected text. I thought need to split the select text from origin item(for example, first character of selected text is not begin at item), and apply those new item protect style.

how to split those item? I thought insert checkpoint can do,but I know that is not best solution.

another question. if user do that many times , the doc will have more fragment item. how to avoid more fragmented document?
chuqingsheng
Posts: 38
Joined: Sat Nov 06, 2010 5:12 am

Post by chuqingsheng »

another question, I need draw a border for the protected text to let those text can be distinguish from other normal text. how to that ? please give me some guide
Sergey Tkachenko
Site Admin
Posts: 17572
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

To change attributes of the selected text, use ApplyStyleConversion method. You need to implement OnStyleConversion event where you can return the index of the style with midified Protection property.
The example of implementation of this event can be found in Demos\*\Editors\Editor 2\
chuqingsheng
Posts: 38
Joined: Sat Nov 06, 2010 5:12 am

Post by chuqingsheng »

Sergey Tkachenko wrote:To change attributes of the selected text, use ApplyStyleConversion method. You need to implement OnStyleConversion event where you can return the index of the style with midified Protection property.
The example of implementation of this event can be found in Demos\*\Editors\Editor 2\
thank. That's great!
Post Reply