For i = 0 To Table.Size - 1 'Creating The Itmes Parents and childs
Cols = Table.Get(i)
' clvDoh.Add (CreateListItem($"Item #${i}"$, clvDoh.AsView.Width, 70dip) , $"Item #${i}"$)
clvDoh.Add(CreateListItem($"Item #${i}"$, clvDoh.AsView.Width, clvDoh.AsView.Height), $"Item #${i}"$)
Next
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
Dim su As StringUtils
Dim stmp As String
Dim item As ItemProp
p.Initialize("")
'we need to add the panel to a parent to set its dimensions. It will be removed after the layout is loaded.
' Activity.AddView(p, 0, 0, Width, Height)
' p.LoadLayout("listitem")
p.SetLayout(0, 0, Width, Height)
p.LoadLayout("listitem")
' p.Background = Colors.Black
p.RemoveView
'label1 and button1 will point to the last added views.
lblDetails.TextColor = Colors.Black
lblTel.TextColor = Colors.Black
' lblDetails.Color=Colors.Gray
' lblTel.Color = Colors.Green
Try
item.Initialize
item.Recid = Cols(0)
item.MisparTofes = Cols(1)
item.Shlav = Cols(13)
lblDetails.Tag = item '
stmp = Cols(6) & CRLF & Cols(5) 'sha + shemlako
If ModFunc.Len(Cols(7)) > 0 Then 'ktovetlako
stmp = stmp & CRLF & Cols(7)
End If
If ModFunc.Len(Cols(10)) > 0 Then 'teorparit
stmp = stmp & CRLF & "תאור: " & Cols(10)
End If
If ModFunc.Len(Cols(11)) > 0 Then 'degem
stmp = stmp & CRLF & "דגם: " & Cols(11)
End If
'===================================
'26-11-2017
If Starter.bShowTarikHatkana Then
If ModFunc.Len(Cols(25)) > 0 And Cols(25) <> "01.01.1900" Then 'TarikHatkana
stmp = stmp & CRLF & "תאריך התקנה: " & Cols(25)
End If
End If
'===================================
If ModFunc.Len(Cols(12)) > 0 Then 'takala
' stmp = stmp & CRLF & "תקלה: " & Cols(12)
stmp = stmp & CRLF & Starter.sTakalaName & Cols(12) '26-09-2019
End If
stmp = stmp & CRLF
'==================================
'21-01-2018
cs = ModFunc.MarkPattern(stmp, "\d\d\d\d\d\d\d\d\d+", 0)
lblDetails.Text = cs
cs.EnableClickEvents(lblDetails)
'==================================
'21-01-2018 lblDetails.Text = stmp
lblTel.Text = Cols(8)
If Cols(34).Length > 0 Then '26-09-2019 Akrai
lblTel.Text = Cols(8) & CRLF & Cols(34)
End If
'==================================
'02-01-2018
lblHatra.Visible = False
If ModFunc.Val(Cols(18)) > 0 Then
lblHatra.Text = "התראה " & Cols(18) & " דק'"
lblHatra.Visible = True
End If
'==================================
If stmp.Length > 0 Then
'21-01-2018 lblDetails.Text = stmp
lblDetails.Height= su.MeasureMultilineTextHeight(lblDetails, lblDetails.Text)+ 2%y
iItemHeight = lblDetails.Height
End If
'==================================
'07-01-2018
lblOved.Visible = False
If Starter.bMenahelAvoda Then
If ModFunc.Len(Cols(26)) > 2 Then
lblOved.Text = "טכנאי: " & Cols(26).SubString2(0,Cols(26).Length -2)
lblOved.Visible = True
lblOved.Top = lblDetails.Top + lblDetails.Height
iItemHeight = iItemHeight + lblOved.Height
Else
If ModFunc.Len(Cols(15)) > 2 Then
lblOved.Text = "טכנאי: " & Cols(15)
lblOved.Visible = True
lblOved.Top = lblDetails.Top + lblDetails.Height
iItemHeight = iItemHeight + lblOved.Height
End If
End If
End If
'==================================
If ModFunc.Val(Cols(20)) = 1 Then 'status
lblDetails.Color=Colors.ARGB(255,192,255,192)
lblTel.Color=Colors.ARGB(255,192,255,192)
p.Color=Colors.ARGB(255,192,255,192)
End If
'==================================
'15-01-2018
If Starter.bUserHag(0) Then
Dim cTmpRec As Cursor
Dim res(4) As Int
cTmpRec = DBUtils.FnOpenRecSet(Starter.sql,"select * from StatusColors where TeorStatus = " & DBUtils.Fmsg(Cols(22)) )
If cTmpRec.RowCount > 0 Then
cTmpRec.Position = 0
If ModFunc.Nul(cTmpRec.GetString("Zeva"), True).Length > 0 Then
res=ModFunc.getRGB(cTmpRec.GetString("Zeva"))
lblDetails.Color=Colors.RGB(res(0),res(1),res(2))
lblTel.Color=Colors.RGB(res(0),res(1),res(2))
p.Color=Colors.RGB(res(0),res(1),res(2))
End If
End If
If ModFunc.Val(Cols(20)) = 1 Then 'status
res=ModFunc.getRGB(12640511)
lblDetails.Color=Colors.RGB(res(0),res(1),res(2))
lblTel.Color=Colors.RGB(res(0),res(1),res(2))
p.Color=Colors.RGB(res(0),res(1),res(2))
End If
Else
If Starter.bYeshKibuy Then '29-07-2019
If DBUtils.FnQueryOK("select 1 from DohKibuyImg where sug = 271 And MisTofes = " & item.MisparTofes & CRLF & _
" and Shlav = " & item.Shlav & " LIMIT 1 ") Then
p.Color=Colors.Green
End If
End If
End If
'==================================
'23-09-2019
If Starter.bYeshKibuy Then
Dim imgSeker As ImageView
If DBUtils.FnQueryOK("select 1 from DohKibuyImg where sug = 271 And MisTofes = " & item.MisparTofes & CRLF & _
" and Shlav = " & item.Shlav & " LIMIT 1 ") Then
imgSeker.Initialize("imgSeker")
p.AddView(imgSeker, 5%x , lblDetails.Height / 2 , lblTel.Width , lblTel.Width)
ModFunc.FitBitmapToImage(imgSeker,"seker.png","")
End If
End If
'==================================
Catch
Log(LastException)
End Try
Return p
End Sub