A while back, I posted Method of the Day: AppendHotspot
and Method of the Day: ReplaceText
and considered turning it into a regular series like the Rich Text 101 series (see the right hand panel on my blog for that series), but time got away from me. But a question in our Support forum from a Midas user made me realize that there is a method I use a lot that was not properly documented in our Help database, the AppendParagraph method
Like many methods in our Midas Rich Text LSX, the AppendParagraph method packs a lot of punch into a single method. Not only can you add a paragraph, you can set the styles for the paragraph, set the initial font, color and styles for the text in the paragraph, and even add a hide-when formula while you are at it. When I was building samples for my SpeedGeeking session on layers, I used this extensively, since it makes it ewasy to set up a paragraph to look and act the way you want in one concise call. For example, setting up the animated progress bar, I used the following code snippet:For
"Plain 10pt Black",
i > 10 Then Call
|LayerHTMLID='L'+Cstr(i) BackgroundImage='lssubbanner.jpg' BackgroundRepeat='once' Text='|+Cstr(i)+|%' TextFont='Arial Bold 18pt Blue' |, "Above='Single' Justify='Center' ") Else Call
|LayerHTMLID='L'+Cstr(i) BackgroundImage='lssubbanner.jpg' BackgroundRepeat='once' |, "") End IfNext Call
For each loop, I added a paragraph with a slightly different hide-when formula, then added a layer with content (and its own paragraph style). Imagine how much harder this would be with the Notes rich text classes, even if they did allow you to create the layer.
Copyright © 2007 Genii Software Ltd.