Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private btn1 As Button
Private FormLV As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
MainForm.RootPane.LoadLayout("Main") 'Load the layout file.
MainForm.Show
End Sub
Sub btn1_Action
FileSelect
End Sub
Sub FileSelect
'Create the modal form:
FormLV.Initialize("", 300, 500)
FormLV.SetFormStyle("UTILITY")
'Create the listview:
Private lv As ListView
lv.Initialize("lv")
'Add the listview:
FormLV.RootPane.AddNode(lv, 0, 0, -1, -1)
FormLV.RootPane.SetAnchors(lv, 0, 0, 0, 0)
'Fill the data:
For i = 0 To 100
Dim lbl As Label
lbl.Initialize("")
lbl.Text = 12345 * Rnd(1, 999) 'just some random stuff
lv.Items.Add(lbl)
Next
'Show the modal form:
FormLV.ShowAndWait
End Sub
Sub lv_SelectedIndexChanged(Index As Int)
Dim lv As ListView = Sender
Dim lbl As Label = lv.Items.Get(Index)
Log($"Data clicked : ${lbl.Text}"$)
'Close the modal form:
FormLV.Close
End Sub