How do I style paragraphs in a field in LiveCode 5.5?
In this lesson we will look at the new field features in LiveCode 5.5.
Create a stack with a field of text
Center align our paragraph (textAlign Property)
Highlight our paragraph (backgroundColor property)
Give our paragraph a strong border (borderWidth and borderColor properties)
Pad our paragraph from it's border (padding property)
Indent the first line of our paragraph (firstIndent property)
Indent our paragraph (leftIndent and rightIndent properties)
Add space above and below our paragraph (spaceBefore and spaceAfter properties)
Summary
All of the above steps can be gathered into a single routine to set the style of a particular run of text such as the paragraph in this example:
set the textalign of line 3 of field "content" to "left"
set the backgroundcolor of line 3 of field "content" to "200,180,241"
set the bordercolor of line 3 of field "content" to "30,30,30"
set the borderwidth of line 3 of field "content" to 5
set the padding of line 3 of field "content" to 15
set the firstindent of line 3 of field "content" to 40
set the rightIndent of line 3 of field "content" to 30
set the leftIndent of line 3 of field "content" to 30
set the spaceAbove of line 3 of field "content" to 18
set the spaceBelow of line 3 of field "content" to 18









Add your comment