properties vs local variable

Peter Haworth pete at lcsql.com
Mon Mar 10 16:04:18 EDT 2014


A sample line would be:

<font color="#<colorspec>" bgcolor="#<bgcolorspec>" <your text> </font>

colorspec and bgcolor spec are a hash mark followed by three hex numbers
representing the rgb color.  I think you can use a color name too but not
sure.

So using one of your examples you would set the htmltext of field x to
"<font color="#255,255,255" bgcolor="#62,117,215"> this is my text </font>


Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


On Mon, Mar 10, 2014 at 12:29 PM, Terence Heaford
<t.heaford at btinternet.com>wrote:

> I'm trying to understand your solution but having looked at htmlText of
> field I am not getting it.
>
> I follow that changing the colour of the field is time consuming.
>
> Are you suggesting I can change the colour of the field using the htmlText
> and the merge command?
>
> A sample line would be useful because I am not familiar with using the
> htmlText. I am familiar with merge.
>
> Can you provide a sample line that would place some text in a field and
> change the backgroundColor of the field.
>
> All the best
>
> Terry
>
>
> On 10 Mar 2014, at 16:46, J. Landman Gay <jacque at hyperactivesw.com> wrote:
>
> > Since colors can only be applied directly to fields, you can't
> manipulate those in variable. But you can create htmltext and then set the
> field's htmltext at one go. In this case that's what I'd do. To get proper
> html for the field, just manually set up the field colors once and put the
> field's htmltext into the message box. Use that text as a template to
> script the changes. I frequently store template htmltext as a custom
> property of the field, with merge markers ("[[tBackColor]]"). Then when I
> need to update the htmltext, I use the merge command. It's a one-liner and
> very fast.
> >
> > I think if you use this method you will notice a dramatic increase in
> speed.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list