Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("pgBasket")
fgBasket.ColsName=Array As String("الرمز","اسم الصنف","المبلغ","العدد","الخصم","النسبة")
Log("basket")
Dim s As Int = lbl_titl3.Width
Log(s)
fgBasket.ColsWidth=Array As Int(s*20/100,s*36/100,s*11/100,s*11/100,s*11/100,s*11/100)
fgBasket.ColsType=Array As Int(fgBasket.TypeString ,fgBasket.TypeString,fgBasket.TypeString,fgBasket.TypeString,fgBasket.TypeString,fgBasket.TypeString)
fgBasket.ColsAlignment=Array As String("CENTER","CENTER","CENTER","CENTER","CENTER","CENTER")
End Sub
Private Sub B4XPage_Appear
For i = fgBasket.RowCount -1 To 0 Step -1
fgBasket.RemoveRow(i)
Next
Main.items(Main.max_item_order,1) = ""
For i = 1 To 99
If Main.items(i,1).Length>0 Then
fgBasket.AddRow(Array As Object(Main.items(i,1),Main.items(i,2),Main.items(i,7),Main.items(i,5),Main.items(i,6),Main.items(i,8)),True)
fgBasket.SetRowHeight(i-1,60dip)
End If
Next
End Sub