Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Type typeSpinner(lb As Label,spinnerDesc As String,lstOfItems As List,selectedIndex As Int)
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private sv As ScrollView,pnlSv As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
sv.Initialize(1000dip)
pnlSv=sv.Panel
Activity.AddView(sv,0,0,100%x,100%y)
For i=0 To 99
Private lb As Label
lb.Initialize("")
lb.Text="spinner "&i
Private lstOfItems As List
lstOfItems.Initialize
For j=0 To 99
lstOfItems.Add("spinner "& i & " -> item "&j)
Next
Private btnSpinner As Button
btnSpinner.Initialize("btnSpinner")
Private tempSpinnerType As typeSpinner
tempSpinnerType.Initialize
tempSpinnerType.lb=lb
tempSpinnerType.spinnerDesc="my spinner "&i
tempSpinnerType.lstOfItems=lstOfItems
tempSpinnerType.selectedIndex=-1
btnSpinner.Tag=tempSpinnerType
btnSpinner.Text="v"
pnlSv.AddView(lb,0,i*40dip,200dip,39dip)
pnlSv.AddView(btnSpinner,201dip,i*40dip,39dip,39dip)
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnSpinner_click
Private btnSpinner As Button=Sender
Private tempSpinnerType As typeSpinner=btnSpinner.Tag
Private lb As Label=tempSpinnerType.lb
Private spinnerDesc As String=tempSpinnerType.spinnerDesc
Private lstOfItems As List=tempSpinnerType.lstOfItems
Private selectedIndex As Int=tempSpinnerType.selectedIndex
InputListAsync(lstOfItems, "Select Value of "&spinnerDesc,selectedIndex, True)
Wait For InputList_Result (Index As Int)
If Index <> DialogResponse.CANCEL Then
Private selectedVal As String=lstOfItems.Get(Index)
lb.Text=selectedVal
tempSpinnerType.selectedIndex=Index
End If
End Sub