Grazie Luca, in effetti la spiegazione è un tantino contorta ( per colpa mia non ho studiato informatica )
non riesco a caricare l'intera cartella zippata di 430 kb mi da errore, pur essendo inferiore hai 512 consentiti!
nella seconda ListView dove si dovrebbero trovare i pulsanti, dovrei poter inserire ulteriori dati, ed salvare tutto in un file.txt.
Grazie mille " siete sempre disponibili Grazie"
Sub Globals
Private clv1 As CustomListView
Private clv2 As CustomListView
Private Label1 As Label
Private Button1 As Button
Private Button2 As Button
Private qt As String
Private panl As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
prodotti_click
End Sub
Sub clv1_ItemClick (Index As Int, Value As Object)
Activity.Title = Value
End Sub
Sub clv2_ItemClick(Index As Int, Value As Object)
Log(Index & " = " & Value)
End Sub
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.LoadLayout("CellItem")
p.RemoveView
Label1.Text = Text
Return p
End Sub
Sub Button1_Click
Dim index As Int = clv1.GetItemFromView(Sender)
Dim pnl As Panel = clv1.GetPanel(index)
Dim lbl As Label = pnl.GetView(0)
Dim btn As Button = pnl.GetView(0)
If btn.Text="" Then
btn.Text="0"
End If
qt=btn.Text+1
btn.Text=qt
'Msgbox("Item value: " & clv2.GetValue(index) & CRLF & "Check value: " & chk.Checked, "")
End Sub
Sub Button1_LongClick
Dim index As Int = clv1.GetItemFromView(Sender)
Dim pnl As Panel = clv1.GetPanel(index)
Dim lbl As Label = pnl.GetView(0)
Dim btn As Button = pnl.GetView(0)
If btn.Text="" Then
btn.Text="0"
End If
qt=btn.Text-1
btn.Text=qt
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub prodotti_click
Dim i As Int
Dim fileProd As String
Dim Button1 As Button
fileProd="Pizze.txt"
Private Reader As TextReader
Reader.Initialize(File.OpenInput(File.DirRootExternal, fileProd))
Private line As String
line = Reader.ReadLine
'*****************Label1.Text=line
Do While line <> Null
i=i+1
clv2.Add(CreateListItem(line, clv2.AsView.Width, 50dip), 50dip, "")
Log(line)
line = Reader.ReadLine
Loop
Reader.Close
End Sub
Sub Button2_Click
End Sub
Sub Label1_Click
Dim index As Int = clv2.GetItemFromView(Sender)
Dim pnl As Panel = clv2.GetPanel(index)
Dim lbl As Label = pnl.GetView(1)
clv1.Add(CreateListItem(lbl.Text ,clv1.AsView.Width,70dip),70dip,$"Item{i}"$)
End Sub