Sub ProcessCursor
messages = CallSub(MessageService, "GetMessages")
Dim Panel0 As Panel
Dim PanelTop, PanelHeight As Int
Panel0.Initialize("")
PanelTop = 0
Panel0.Color = Colors.Transparent
SV.Panel.AddView(Panel0, 5dip, 5dip, SV.Width-10dip, SV.Height-10dip)
SV.FullScroll(True)
For i = 0 To messages.RowCount - 1
messages.Position = i
Dim Label2 As Label
Label2.Initialize("")
Panel0.AddView(Label2, 0, PanelTop, SV.Width, PanelHeight)
Label2.Color = Colors.Transparent
Label2.TextColor = Colors.Black
Label2.TextSize = 18
Label2.Text = "Mensagem #"& (messages.RowCount - i) & CRLF & messages.GetString("message")
Log(Label2.Text)
Dim str As StringUtils
Dim h As Int = str.MeasureMultilineTextHeight(Label2, Label2.Text)
PanelHeight = h
Label2.Height = h
PanelTop = PanelTop + PanelHeight + 10dip
SV.Panel.Height = PanelTop
Next
End Sub