rtLib — Notes Rich Text Management Library Documentation of rtLib — Notes Rich Text Management Library Download rtLib — Notes Rich Text Management Library FAQ of rtLib — Notes Rich Text Management Library Purchase rtLib — Notes Rich Text Management Library Feedback about rtLib — Notes Rich Text Management Library

Cookbook

Rulers

Start search Mail feedback Back to Description


rtHRule rtColor

add (rtContainer) Add (rtCollection) Add (rTextParagraph) Collection (rtContainer) Collection (rtEnumeration) Color (rtFontstyle) Color (rtHRule) fitToWindow getRichTextItem hasGradient (rtColor) hasGradient (rtHRule) hasMoreElements NextElement RuleHeight RuleWidth setAltRGB setRGB

Code fragment from sample "Rulers"; see full running samples in downloadable help.
Dim i As Integer, rule As rtHRule

call ctxDump.getRichTextItem(doc,"Body")

Set hotcoll = ctxDump.Collection(PARSE_GROUP_GRAPHIC)

Dim enum As New rtEnumeration(hotcoll), o
Do While enum.hasMoreElements
Set o = enum.nextelement
o.RuleHeight= Cint(8000*Rnd) Mod 5*ONE_CM' set it random height (up to 5 cm) and random (gradient) color
o.Color.setAltRGB Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255
Loop
' let's create 10 random size random color rulers!
For i=0 To 10
Set rule = New rtHRule(Cint(10000*Rnd) Mod 5*ONE_CM)
Set rule.Color = New rtColor(0)
rule.fitToWindow=True
rule.hasGradient = True
rule.Color.setAltRGB Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255
rule.Color.setRGB Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255,Cint(10000*Rnd) Mod 255
rule.RuleWidth=Cint(10000*Rnd) Mod 60
ctxDump.add rule
Next