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: 35
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 »

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: 17569
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 »

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: 35
Joined: Tue Jun 25, 2013 10:42 am

Text style properties can still be deleted after setting them

Post by th9999 »

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 94384 times
Sergey Tkachenko
Site Admin
Posts: 17569
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 »

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: 35
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 »

Thank you administrator. I'll try something else.
th9999
Posts: 35
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 »

Hi administrator, the version number of my directory SRichViewEdit is v5.9.6. Do you need to upgrade?
Sergey Tkachenko
Site Admin
Posts: 17569
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 »

You use very old version of ScaleRichView. Currently, the newest version is 8.5. So I highly recommend to upgrade.
th9999
Posts: 35
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 »

How do I upgrade now excuse me, should be buying again?
th9999
Posts: 35
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 »

I have purchased "TRichView+ScaleRichView", may I ask how to upgrade it now? thank you
Sergey Tkachenko
Site Admin
Posts: 17569
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 »

I answered in a private message.
th9999
Posts: 35
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 »

Hello administrator,
I have updated the latest version I purchased, but I have set it as you said, I can still delete the rectification project, my code is as follows:

RVStyle1.TextStyles[11].EmptyWidth := 1;
RVStyle1.TextStyles[11].Protection := [rvprDeleteProtect, rvprStyleSplitProtect, rvprConcateProtect];
Sergey Tkachenko
Site Admin
Posts: 17569
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 »

Can you create a simple project reproducing this problem and send it by email?


PS: after reading your post in the private forum, I think that there is a possibility that you still compile the project using older version of ScaleRichView. I may be the reason of this problem.
Post Reply