Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private ScrollPane1 As ScrollPane
Private cv As Canvas
Private InnerPane As Pane
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
End Sub
Sub Button1_Click
ScrollPane1.LoadLayout("dummy",1000,1000)
InnerPane = ScrollPane1.InnerNode
InnerPane.RemoveAllNodes
If Not(cv.IsInitialized) Then cv.Initialize("Canvas")
InnerPane.AddNode(cv, 0, 0, InnerPane.PrefWidth, InnerPane.PrefHeight)
DrawGraph
End Sub
Sub Button2_Click
ScrollPane1.LoadLayout("dummy",2000,2000)
InnerPane = ScrollPane1.InnerNode
InnerPane.RemoveAllNodes
If Not(cv.IsInitialized) Then cv.Initialize("Canvas")
InnerPane.AddNode(cv, 0, 0, InnerPane.PrefWidth, InnerPane.PrefHeight)
DrawGraph
End Sub
Sub DrawGraph
Dim y,r,s As Int
If Not(cv.IsInitialized) Then Return
cv.DrawRect(0,0,cv.Width,cv.Height,fx.colors.black,True, 0 )
y = cv.Height/2
s = 5
For i= s To cv.Width-1 Step s
r =Rnd(-400,400)
cv.DrawLine(i-s,y,i,cv.Height/2+r,fx.Colors.Yellow,2.2)
y = cv.Height/2+r
Next
cv.DrawLine(0,cv.Height/2,cv.Width-1,cv.Height/2,fx.Colors.Red,2.2)
End Sub