Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
#If B4J
Private scpTest As ScrollPane
#End If
Private xpnlText As B4XView
Private xcvsTest As B4XCanvas
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
'Dummy is an empty layout, it is needed to get the internal Pane, and it sets the inner Pane dimensions
scpTest.LoadLayout("Dummy", 1000, 1000)
MainForm.Show
InitCanvas
DrawText
End Sub
Private Sub InitCanvas
#If B4J
xpnlText = scpTest.InnerNode
xcvsTest.Initialize(xpnlText)
#End If
End Sub
Private Sub DrawText
xcvsTest.DrawText("Text 1", 10, 20, xui.CreateDefaultFont(12), xui.Color_Black, "LEFT")
xcvsTest.DrawText("Text 2", 10, 40, xui.CreateDefaultFont(12), xui.Color_Black, "LEFT")
xcvsTest.DrawText("Text 3", 10, 60, xui.CreateDefaultFont(12), xui.Color_Black, "LEFT")
xcvsTest.DrawText("Text 4", 10, 80, xui.CreateDefaultFont(12), xui.Color_Black, "LEFT")
xcvsTest.DrawText("Text 5", 10, 980, xui.CreateDefaultFont(12), xui.Color_Black, "LEFT")
xcvsTest.DrawText("Text 6", 990, 980, xui.CreateDefaultFont(12), xui.Color_Black, "RIGHT")
End Sub