Edit text size

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DavJans
Posts: 270
Joined: Thu Dec 12, 2013 4:21 pm
Location: Spokane, WA USA

Edit text size

Post by DavJans » Tue Jul 30, 2019 6:03 pm

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?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: Edit text size

Post by SparkOut » Tue Jul 30, 2019 6:15 pm

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 :)

DavJans
Posts: 270
Joined: Thu Dec 12, 2013 4:21 pm
Location: Spokane, WA USA

Re: Edit text size

Post by DavJans » Tue Jul 30, 2019 6:21 pm

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 :)
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Edit text size

Post by bogs » Tue Jul 30, 2019 7:16 pm

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 7364 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....
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Edit text size

Post by dunbarx » Tue Jul 30, 2019 8:39 pm

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
Last edited by dunbarx on Wed Jul 31, 2019 1:18 am, edited 1 time in total.

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: Edit text size

Post by SparkOut » Tue Jul 30, 2019 9:22 pm

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.)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”