How to protect objects within a group?

Graham Samuel livfoss at mac.com
Thu Jun 20 15:08:01 EDT 2013


Thanks, Klaus and Scott. Actually I did count down to 1, but did not explain that properly. It's an important point though. Thanks Klaus, I suppose I will have to be happy with "the owner of". What disturbs me is that this doesn't correspond to what the IDE does, where individual objects in a group can be rendered non-selectable by setting selectGroupedControls. Although this property exists outside the IDE, it doesn't seem to do the same thing as it does within it.

Anyway thanks again to both - at least I know what to do now.

Graham

On 20 Jun 2013, at 20:37, Scott Rossi wrote:

> Also, when deleting objects via a loop, it's generally better to start
> from the number of objects and count down to 1.  The overall object count
> is reduced every time an object is deleted and will get out of sync with
> the repeat count if starting from 1.
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX/UI Design
> 
> 
> 
> 
> On 6/20/13 4:29 AM, "Klaus major-k" <klaus at major-k.de> wrote:
> 
>> Hi Graham,
>> 
>> Am 20.06.2013 um 13:04 schrieb Graham Samuel <livfoss at mac.com>:
>> 
>>> I have a kind of drawing space on a card where a user can create
>>> graphics. I also have a group showing on this card, which is in fact a
>>> group of mixed controls, including both graphics and fields,. I have a
>>> button that deletes all the graphics on the card by simply doing a loop
>>> from 1 to the number of grcs on the card and deleting each grc as it
>>> passes through. My group (which I don't want to delete) clearly is not
>>> itself a graphic: nevertheless my button deletes all the graphics in the
>>> group, from which it appears that each graphic can be accessed
>>> separately even when it' s grouped.
>>> 
>>> I thought that by setting the selectGroupedControls to false, I would
>>> protect the graphics inside the group from being selected. Not
>>> apparently if the selection is done by script. I also tried setting the
>>> cantDelete of the group to true, and that didn't seem to work either:
>>> elements of the group can still be deleted.
>>> 
>>> Luckily in this specific case there is only the one group on the card,
>>> so I can tell my loop not to delete those graphics that have the word
>>> "group" in their long ID, and this works.
>>> 
>>> This seems incredibly clunky: is there another way to distinguish
>>> between graphics (or in principle, other objects) within a group and
>>> graphics outside?
>> 
>> you can check "the owner of grc xyz" or "the short name of the owner of
>> grc xyz" in the repeat loop.
>> 
>> This will be :
>> 1. INSIDE -> the name of the group -> group "name of group"
>> 2. OUSIDE -> the name of the the card -> card "name of card"
>> 
>>> TIA
>>> 
>>> Graham
>> 
>> Best
>> 
>> Klaus
>> 
>> --
>> Klaus Major
>> http://www.major-k.de
>> klaus at major-k.de
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list