Sub Globals
Private Btn_sair As Button
Dim Bmp1 As Bitmap
Private Label1 As Label
Private clv As CustomListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Menu_OT")
Activity.Title=" " & "MENU - Ordens de Trabalho"
Bmp1.Initialize(File.DirAssets, "obras_32.png")
Btn_sair.Text="Exit"
Label1.Text="Selecionar_a_opção :"
clv.Clear
' clv.Add(CreateListItem("Consulta de O.T.",clv.AsView.Width, 52dip),52dip,1)
' this is my old code, where clv.add() had 3 parameters. The parameter height disapear on the new customlistview.Add
clv.Add(CreateListItem("Consulta de O.T.",clv.AsView.Width,52dip), 1)
clv.Add(CreateListItem("Informação de O.T.",clv.AsView.Width,52dip),4)
clv.Add(CreateListItem("Abertura de O.T.",clv.AsView.Width, 52dip), 2)
clv.Add(CreateListItem("Historico do ativo",clv.AsView.Width, 52dip),3)
End Sub
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.Color = Colors.Black
Dim img As ImageView
img.Initialize("")
img.Bitmap=Bmp1
Dim lbl As Label
lbl.Initialize("")
lbl.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lbl.Text = Text
lbl.TextColor = Colors.White
lbl.TextSize = 16
p.AddView(img, 10dip, 10dip, 32dip, 32dip) 'view #0
p.AddView(lbl,55dip,5dip, Width, 36dip) 'view #1
Return p
End Sub
Sub clv_ItemClick (Position As Int, Value As Object)
Select Value
Case 1
Activity.Finish
StartActivity(FILTRO_OT2)
Case 2
CallSubDelayed3(OTN, "ShowList","Menup2",0)
Case 3
StartActivity(Equip_Hist2)
Case 4
StartActivity(OT_INFO2)
End Select
End Sub