Setting cantDelete of a field

Knapp Martin martyknappster at gmail.com
Fri Feb 16 14:54:12 EST 2018


I have an app where the user can create a document from a pre-made template and add some of their own fields, lines, etc. They can delete those, but there are objects that they should not. So I use a front script and trap for all the variations of delete, cut, etc. I set a custom property for the objects that should not be deleted (cpCantDelete) and the front script checks the cpCantDelete of the selectedObject. Maybe set up the development environment with a similar front script and a feature where right-clicking with a modifier key (so you can still access the LC popup too) pops up a menu to make setting the custom property quick and easy.

Marty

> Hi,
> 
> A colleague who is working in a LC stack has several times in the past, and just again today, accidentally deleted fields of a group acting as a background. He doesn’t notice the field is deleted, saves the stack, and all his text on many cards is gone.
> 
> LiveCode has a cantDelete property that can be set for stacks, groups, and cards. Is there any particular reason why fields or any other control cannot have that property?
> 
> I know about the cantModify, but that is a stack level property that doesn’t allow anything to be modified.
> 
> I just want to set the cantDelete property of valuable objects to true.
> 
> Peter Bogdanoff
> ArtsInteractive




More information about the Use-livecode mailing list