Sub CreateBasicListItem(ItemID As Int, CatItem As String, Price As String, Pic As Int, Qty As String, Frq As String, Selct As Int, Width As Int, Height As Int, clr As Int) As Panel
' ITEMS
Dim p As Panel
p.Initialize("")
p.Color = Colors.White
p.Tag = "Itm"
' CAT / ITEM
Dim lbl As Label
lbl.Initialize("")
lbl.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lbl.Text = CatItem
lbl.TextSize = ListFontSize
lbl.TextColor = Colors.Gray
' €
Dim Cost As Label
Cost.Initialize("")
Cost.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.RIGHT)
Cost.Text = NumberFormat2(Price,0,2,2,False)
Cost.TextSize = ListFontSize
Cost.TextColor = Colors.Gray
Cost.Tag = "Cost"
' Camera
Dim im As ImageView
im.Initialize("")
If Pic = 1 Then
im.Bitmap = LoadBitmapSample(File.DirAssets,"camera.jpg",18,14)
End If
' Qty
Dim Qnty As Label
Qnty.Initialize("")
Qnty.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.CENTER)
Qnty.Text = Qty
Qnty.TextSize = ListFontSize
Qnty.TextColor = Colors.Gray
Qnty.Tag = "Qnty"
' FR
Dim Freq As Label
Freq.Initialize("")
Freq.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.LEFT)
Freq.Text = mapFreq.Get(Frq)
Freq.TextSize = ListFontSize
Freq.TextColor = Colors.Gray
Freq.Tag = "Freq"
' Tick
Dim Sel As CheckBox
Sel.Initialize("sel")
Sel.Gravity = Bit.Or(Gravity.NO_GRAVITY, Gravity.LEFT)
' Sel.Tag = "1"
' If Sel.Tag = 1 Then ..... else
'
Dim Btmp As Bitmap
Btmp = LoadBitmap(File.DirAssets, "TickBox_star_gray.png")
Sel.SetBackgroundImage(Btmp)
Sel.TextSize = 6
Sel.TextColor = Colors.Black
' Sel.Color = clr
Sel.Tag = ItemID
' Log (Sel.Tag)
If Selct = 0 Then
Sel.Checked = False
Else
Sel.Checked = True
' Sel.SetBackgroundImage(BtmpYes)
End If
p.AddView(lbl, 5dip, 2dip, 305dip, Height - 4dip) 'cat/Item
p.AddView(Cost, 305dip, 2dip, 65dip, Height - 4dip) 'Item Cost
p.AddView(im,370dip,2dip,75dip,Height - 4dip)' image
p.AddView(Qnty,435dip,2dip,50dip,Height - 4dip)' Quantity
p.AddView(Freq,490dip,2dip,50dip,Height - 4dip)' Frequency
p.AddView(Sel,550dip,2dip,50dip,Height - 4dip)' Select
SetTextColorForRow(p,Sel, Colors.Black,Colors.gray) ' set the text color
Return p
End Sub