Page 1 of 1
Set all the fields properties on a single instruction
Posted: Fri Jul 15, 2016 5:00 pm
by Hery
Do you know if is possible to set all the fields properties on a single instruction.
I need something like that:
"Set the textSize of all fields to 12"
Thanks a lot
Re: Set all the fields properties on a single instruction
Posted: Fri Jul 15, 2016 5:10 pm
by FourthWorld
If you leave the textSize of the fields to empty, setting the textSize of their parent object will set the size of all objects within it. If the parent object is a card it will affect all objects which don't have their textSize set, so if there are buttons or other controls you want with a different size perhaps you could put your fields in a group and then set the group's textSize.
Re: Set all the fields properties on a single instruction
Posted: Fri Jul 15, 2016 6:11 pm
by dunbarx
What Richard said.
Know that if you have a single field with special properties, there is a property called, er, the "properties". Setting the properties of all your fields to the "properties" of a special field will do just that. This may go too far. For example, the rects of all those fields will also be set, so they will all overlie each other.
You do know about the "templateField", right?
Otherwise you can make a list of specific properties, store that somewhere, and loop through that list, setting as you go. Each line might have a property and a value, like "textFont,Geneva".
Something like(pseudo)
Code: Select all
repeat with y = 1 to the number of flds
if fld y is a field you want to deal with then
repeat with u = 1 to the number of lines of specialPropertiesYouListed
set the item 1 of line u of that list of fld y to item 2 of line u of that list --may need "do"
I said it was pseudo. You may need a "do" contraction in that handler; you will have to check. Should be a hoot to implement.
Craig Newman
Re: Set all the fields properties on a single instruction
Posted: Sat Jul 16, 2016 6:19 pm
by Hery
Thanks to all. I'm doing some test
