Page 1 of 1

Edit text size

Posted: Tue Jul 30, 2019 6:03 pm
by DavJans
When I first started using LiveCode I didn't know that there was a global default text size. Because of that, I have manually changed the text size of every individual object. I am now in need of changing the text size of everything manually to 15 from 18. After updating to version 9 the text doesn't fit in any of my fields or buttons. If there a way to do this other than selecting each individual object?

Re: Edit text size

Posted: Tue Jul 30, 2019 6:15 pm
by SparkOut
Well if you want to reset EVERYTHING to default you could

Code: Select all

repeat with i = 1 to the number of cards of this stack
   repeat with j = 1 to the number of controls of card i of this stack 
      if the textSize of control j of card i of this stack is not empty then
         set the textSize of control j of card i of this stack to empty
      end if
   end repeat
end repeat
I will leave it to you to expand this to cater for substacks :)

Re: Edit text size

Posted: Tue Jul 30, 2019 6:21 pm
by DavJans
Thank you, also I put this in the wrong forum, should not be in announcements and I cant find the delete button. please someone move it or delete it :)

Re: Edit text size

Posted: Tue Jul 30, 2019 7:16 pm
by bogs
Just for future reference, another way to do this is to just select all controls that have text formatting, and in the property inspector, blank out or set the size to whatever you want.

You can see these are the objects I placed on the form...
textSize0.png
Whole lotta objects...
textSize0.png (15.65 KiB) Viewed 7533 times
...Then I set the text size to something too large, OOPS :oops:
textSize2.png
Text size set on multiple objects...
Blanking it sets the size to the defaults.
textSize1.png
...and reset to defaults....

Re: Edit text size

Posted: Tue Jul 30, 2019 8:39 pm
by dunbarx
Hi.

It is not so much as a "default" textSize, (or almost any other text property, such as textFont or textHeight) but that newly created fields inherit these properties from the IDE. I guess you could consider these "defaults", but if you ask for, say, the textFont of a newly created field, it will return empty. Jacque has spoken at length about this subject, and I believe her usual advice is to set the properties of the templateField, and then all new fields will inherit them.

Craig

Re: Edit text size

Posted: Tue Jul 30, 2019 9:22 pm
by SparkOut
Mmm, yes better to think in terms of "inheritance" rather than "defaults".

Set the textSize (or textFont, or backcolor, or other properties) of the parent, and any child objects that do not have the explicit setting, will inherit that from the parent. This could be the stack, the card, the group, etc. The nearest relative ancestor will take precedence (inheritance from the parent - or "owner" - group will apply over any inheritance from the group's owner, eg card, or further up to the stack.)