Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private fx As JFX
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Dim TF As TextFlow
TF.Initialize
TF.AddText("1 2 3").SetColor(fx.Colors.Red).SetUnderline(True)
TF.AddText(CRLF & " 4 5 6 ").SetColor(fx.Colors.Green).SetFont(fx.CreateFont("", 17, True, True))
TF.AddText(CRLF & "7 8 9").SetColor(fx.Colors.Blue).SetStrikethrough(True).SetFont(fx.DefaultFont(20))
Dim pane As Pane = TF.CreateTextFlow 'This pane does not have an click event
Dim responsePaneX As B4XView = xui.CreatePanel("TF") 'This pane DOES have an mouseClicked event
responsePaneX.AddView(pane, 10, 10, 70, 100)
responsePaneX.Tag = "1 2 3 4 5 6 7 8 9"
Root.AddView(responsePaneX, 10, 10, 70, 100)
responsePaneX.SetColorAndBorder(xui.Color_RGB(220, 220, 220), 1, xui.Color_RGB(180, 180, 180), 10)
End Sub
Private Sub TF_MouseClicked(ev As MouseEvent)
Dim vx As B4XView = Sender
Log(vx.tag) '1 2 3 4 5 6 7 8 9
End Sub