Sub FillListView(WithConcerned As String)
ListViewCats.Clear
Dim SQL As SQL = Utils.OpenDatabase("learnarabic.db",False)
Dim RS As ResultSet
ListViewCats.GetBase.Color = Colors.White
RS = SQL.ExecQuery("SELECT * FROM Arabic_Categories where categories = '"& WithConcerned&"'")
Do While RS.NextRow
Dim MyPanel As Panel
MyPanel.Initialize("")
MyPanel = CreateListItem( RS.GetString("english_word"),"("&RS.GetString("transliteration_word")&")",RS.GetString("arabic_word"),ListViewCats.GetBase.Width, 30)
Size = Size + 1
ListViewCats.Add(MyPanel, 30,RS.GetString("id"))
Log(RS.GetString("english_word")&RS.GetString("transliteration_word")&RS.GetString("arabic_word"))
Loop
End Sub
Sub CreateListItem(ENText As String,TText As String,AText As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.SetLayoutAnimated(0, 1, 0, 0, Width, Height)
p.LoadLayout("readerpnl1")
lblEnglish.Text = ENText
lblTrans.Text = TText
lblArabic.Text = AText
Return p
End Sub