How to set an item can not be deleted, but can edit the content inside

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
th9999
Posts: 17
Joined: Tue Jun 25, 2013 10:42 am

How to set an item can not be deleted, but can edit the content inside

Post by th9999 » Sun Mar 10, 2019 2:31 am

Hello administrator

Please tell me how to set an item. The label cannot be deleted in the document, but the content inside can be modified. How to set the TextStyle property,

Thank you very much!

Sergey Tkachenko
Site Admin
Posts: 14332
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to set an item can not be deleted, but can edit the content inside

Post by Sergey Tkachenko » Sun Mar 10, 2019 9:55 am

The simplest solution would be inserting an edit control in TSRichViewEdit, preferably TSRVEdit.

If you want to implement it using a text item, assign the following properties of a text style for this item:
Protection: [rvprDeleteProtect, rvprStyleSplitProtect, rvprConcateProtect]
EmptyWidth: some nonzero value

th9999
Posts: 17
Joined: Tue Jun 25, 2013 10:42 am

Text style properties can still be deleted after setting them

Post by th9999 » Tue Mar 12, 2019 10:18 am

Hello, administrator.

My project is just text, and I can't use TSRVEdit. I set the [rvprDeleteProtect, rvprStyleSplitProtect, rvprConcateProtect] attribute you said, and it can be deleted in the text. Is there any other way to change?

Example: I just want to get the text content underlined in red in the attached image.
Attachments
截图.png
截图.png (20.15 KiB) Viewed 145 times

Sergey Tkachenko
Site Admin
Posts: 14332
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to set an item can not be deleted, but can edit the content inside

Post by Sergey Tkachenko » Tue Mar 12, 2019 5:23 pm

Probably, I do not understand your requirements.
rvprDeleteProtect must prevent the text item from deletion. But it does not protect from modifications, including character deletion. Normally, this option allows deletion of all characters except for the last character. But it EmptyWidth > 0, this option allows deleting all characters, but empty text item is not deleted.

Sorry, I do not understand the example with red underline.

th9999
Posts: 17
Joined: Tue Jun 25, 2013 10:42 am

Re: How to set an item can not be deleted, but can edit the content inside

Post by th9999 » Wed Mar 13, 2019 12:12 am

Thank you administrator. I'll try something else.

th9999
Posts: 17
Joined: Tue Jun 25, 2013 10:42 am

Re: How to set an item can not be deleted, but can edit the content inside

Post by th9999 » Wed Mar 13, 2019 1:41 am

Hi administrator, the version number of my directory SRichViewEdit is v5.9.6. Do you need to upgrade?

Post Reply