Sub CreateItem(h As Int, j As Int, naam As String) As Panel
Dim pnl As Panel, lblNaam,lblCode As Label, chkGreen,chkRed As CheckBox, TextWidth As Int
pnl.Initialize("")
pnl.color=Colors.White
IME.Initialize(Me)
lblNaam.Initialize("") 'View #0
lblNaam.Text = naam
lblNaam.TextColor = Colors.DarkGray
lblNaam.TextSize = 18
If(Activity.Width>=1200) Then
lblNaam.TextSize = 22
End If
lblNaam.Gravity = Gravity.CENTER_VERTICAL
TextWidth=clvRoute.sv.Width - 170dip
pnl.AddView(lblNaam, 0, 0, TextWidth, h)
lblCode.Initialize("") 'View #1
lblCode.Text = CodeList.Get(j)
lblCode.TextColor = Colors.DarkGray
lblCode.TextSize = 18
If(Activity.Width>=1200) Then
lblCode.TextSize = 22
End If
lblCode.Gravity = Gravity.CENTER_VERTICAL
pnl.AddView(lblCode, TextWidth+5dip, 0, 80dip, h)
chkGreen.Initialize("ChkGreen") 'View #2
chkGreen.Color=Colors.Green
pnl.AddView(chkGreen, TextWidth+90dip, 0, 40dip, h)
chkRed.Initialize("ChkRed") 'View #3
chkRed.Color=Colors.Red
pnl.AddView(chkRed, TextWidth+130dip, 0, 40dip, h)
If(CheckGreen.Get(j) = True) Then chkGreen.Checked=True
If(CheckRed.Get(j) = True) Then chkRed.Checked=True
Return pnl
End Sub