storing a group as a customProperty

Richard Gaskin ambassador at fourthworld.com
Mon Mar 23 01:15:34 EDT 2009


Peter Brigham MD wrote:
> But if a group's cantDelete property is true, it protects the group  
> from being deleted but not its contents. Doing a "select all" and then  
> hitting the delete key deletes the objects themselves, no matter if  
> the group's cantDelete property is true or false. And in that case the  
> group is not deleted (no matter if the group's cantDelete property is  
> true or false) -- it just has no controls in it any more. There is no  
> cantDelete property for controls themselves.

One more reason to look forward to the release of v3.5 in a couple 
weeks:  groups now have a selectGroupedControls property.  This property 
governs the same behavior as the global property of the same name, but 
with a scope limited to the group.

Set to true by default to get the behavior we now have, when set to 
false it isn't possible to select any of the group's interior objects 
with the pointer tool.  Handy stuff; makes crafting custom controls much 
simpler.


> I'll have to store the group in a stack and store the stack in a  
> customProp.

You can, but that's a lot of work.  What sort of UI are you providing 
that lets people have unbridled use of the pointer tool and keyboard?

Couldn't you just trap the deleteKey and act on the selectedObjects 
yourself?

I've done a lot of save/restore of objects to/from other locations; not 
too difficult, but also not without surprises you'll discover as you go.

If you can prevent the undesired action from ever happening in the first 
place I suspect you'll save yourself some time.

--
  Richard Gaskin
  Fourth World
  Revolution training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com



More information about the Use-livecode mailing list