#AdditionalJar: sqlite-jdbc-3.7.2
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Slider1 As Slider
Private ImageView1 As ImageView
Private LabelName As Label
PrivateTextFieldDescription As TextField
Private CheckBox1 As CheckBox
Dim DS As DataSet
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("main") 'Load the layout file.
MainForm.Show
File.Copy(File.DirAssets,"test.sql",File.DirTemp,"test.sql")
DS.Initialize(File.DirTemp,"test.sql",False)
DS.AddLinkView(ImageView1,"bitmap")
DS.AddLinkView(LabelName,"name")
DS.AddLinkView(TextFieldDescription,"description")
DS.AddLinkView(CheckBox1,"mycheck")
DS.Query("SELECT * FROM mytable","ID")
Slider1.MaxValue=DS.Size-1
Slider1.Value=0
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub ButtonM_Click
Dim I As Int = Max(0,Slider1.Value-1)
Slider1.Value=I
'DS.PreviousRecord
End Sub
Sub ButtonP_Click
Dim I As Int = Min(DS.Size-1,Slider1.Value+1)
Slider1.Value=I
'DS.NextRecord
End Sub
Sub Slider1_ValueChange (Value As Double)
DS.Position=Value
End Sub
Sub ButtonUpdate_Click
DS.UpdateChange
End Sub