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
Set all the fields properties on a single instruction
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Set all the fields properties on a single instruction
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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Set all the fields properties on a single instruction
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)
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
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
Thanks to all. I'm doing some test 
