Target controls on a card that are *not* part of a placed groups

Charles Warwick charles at techstrategies.com.au
Sun Mar 6 01:57:11 EST 2016


On 6/03/2016 2:54 pm, Sannyasin Brahmanathaswami wrote:
>   
> I'm trying to customize some development tools. A typical use case it to be able to change the button style of all the buttons on a card, but I don't want to touch the style of buttons that are part of top and bottom nav bars that are placed on all cards.  I need to be able to go into a review process and if someone says "Let's see what it looks like if we change the buttons to look like XYZ"
>
> I have this in a field of a tools stack:
>
> backgroundcolor|65,65,65
> ink|blendHardLight
> opaque|true
>
> and a button with this script
>
> on mouseUp
>
> put fld "buttonProps" into tButtonProps
> split tButtonProps with cr and "|"
> set the defaultStack to the topstack
> repeat with x = 1 to (the number of buttons of this card)
> # what I really want to do here is skip all the buttons that are in groups
> # which are placed on all card (or more than one card
>     repeat for each key y in tButtonProps
>       set the y of btn x of this card to tButtonProps[y]
>     end repeat
> end repeat
>
> end mouseUp
You can check the "owner" of the button and see if it is a shared group 
or not.

You can get a list of the shared groups that are being used on a card by 
using "get the sharedGroupNames of card xxx".

For buttons that aren't in groups, the owner will be the card.  If they 
are in a group, the owner of the button will be the group they are in.

Cheers,

Charles





More information about the use-livecode mailing list