Page 1 of 1

textsize

Posted: Wed Jan 02, 2013 1:34 am
by cusingerBUSCw5N
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?

Re: textsize

Posted: Wed Jan 02, 2013 2:07 am
by cusingerBUSCw5N
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.

Re: textsize

Posted: Wed Jan 02, 2013 2:41 am
by Simon
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

Re: textsize

Posted: Wed Jan 02, 2013 4:32 am
by dunbarx
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

Re: textsize

Posted: Wed Jan 02, 2013 4:47 am
by Simon
SWEET!
I always forget to use LC for LC.

Simon