textsize

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
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

textsize

Post by cusingerBUSCw5N » Wed Jan 02, 2013 1:34 am

It could be that I'm working on New Year's Day and my evil gnome that lives in my LiveCode program is angry...but...I can't seem to do something so simple.

I want to change the textsize of a field. It works for most of my fields - but doesn't for others.

I think the issue is that in some of the fields, I have set certain lines to bold or italic... and once I do that, any commands to set the textsize seem to be ignored.

I set a global parameters gtextsentence which switches according to the stackwidth and platform.

So
In preopen card I have:

Code: Select all

 
      global gtextsentence
      put 28 into gtextsentence

  set the textsize of field "label_tasklist" to gtextsentence
In layout I have

Code: Select all

   set the scrollbarwidth of field "label_tasklist" to 40
      set the textstyle of line 4 of field "label_tasklist" to italic
       set the vis of field "label_tasklist" to true
It does this nicely on my laptop. But when I put it in test mode, where the gtextsentence changes to 14 - it still looks the same. If I put answer gtextsentence - it gives me 14 - but the text is still the huge 28.

Why is it doing this?

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: textsize

Post by cusingerBUSCw5N » Wed Jan 02, 2013 2:07 am

I think the problem is that I copied some things from Word - and there are probably hidden formatting codes...I'm going to kill the fields and recreate them from scratch.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: textsize

Post by Simon » Wed Jan 02, 2013 2:41 am

Ah yes, if you paste into a field formatted text it holds onto the formatting.
If I have to cut and paste I normally do it twice, once to notepad to remove formatting.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: textsize

Post by dunbarx » Wed Jan 02, 2013 4:32 am

I ran into this when trying to post scripts into the use-list. The copied script was both formatted and colored, and was prevented from being forwarded due to the size of the post.

I just placed a small library function into use, using a "repeat for each" loop through all the chars of the clipboardData, placing that char into a variable, and then reloading the clipboardData.

One click to a function key and I am assured of clean text.

Craig Nwman

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: textsize

Post by Simon » Wed Jan 02, 2013 4:47 am

SWEET!
I always forget to use LC for LC.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply