Page 1 of 1

how to implement that user can protect they selected text?

Posted: Fri Apr 06, 2012 2:03 pm
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?

Posted: Fri Apr 06, 2012 2:27 pm
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

Posted: Fri Apr 06, 2012 4:04 pm
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\

Posted: Sat Apr 07, 2012 6:44 am
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!