Sub AddOrderitem(I As Int)
' Initialize the Panel5
Dim Panel5 As Panel
Dim ImageView1 As ImageView
Panel5.Initialize("Panel5")
Panel5.Color=Colors.Black
scvOrder.Panel.AddView(Panel5,0,PanelTop,100%x,PanelHeight)
' build the ListView from the 1st part (series number)
Dim Label2 As Label
Label2.Initialize("Label2") : Label2.Color=Colors.Black : Label2.Tag="Label2" : Label2.TextSize = 16
Label2.Text = I + 1
Panel5.AddView(Label2,0,5dip,15dip,30dip)
' Build the ItemNumber part
Dim label1 As Label
label1.Initialize("Label1") : label1.Color=Colors.Black : label1.Tag="Label1" : label1.TextSize = 16
label1.Text = OrderItemNumber(I)
Panel5.AddView(label1,70dip,5dip,120dip,30dip)
' Build the image part
ImageView1.Initialize("ImageView1")
ImageView1.Gravity = Gravity.FILL
Log("before I="&I)
ImageView1.SetBackgroundImage(OrderImage(I))
Panel5.AddView(ImageView1,20dip,5dip,25dip,38dip)
Log("after I="&I)
' 再填 Spec
Dim label3 As Label
label3.Initialize("label3") : label3.Color=Colors.Black : label3.Tag="label3" : label3.TextSize = 16
label3.Text = OrderSpec(I)
Panel5.AddView(label3,200dip,5dip,50dip,30dip)
' Build the Qty part
Dim label4 As Label
label4.Initialize("label4") : label4.Color=Colors.Black : label4.Tag="label4" : label4.TextSize = 16
label4.Text = OrderQty(I)
Panel5.AddView(label4,260dip,5dip,20dip,30dip)
' Build the UnitPrice part
Dim label5 As Label
label5.Initialize("label5") : label5.Color=Colors.Black : label5.Tag="label5" : label5.TextSize = 16
label5.Text = OrderUnitPrice(I)
Panel5.AddView(label5,290dip,5dip,30dip,30dip)
' Build the SubTTL part
Dim label6 As Label
label6.Initialize("label6") : label6.Color=Colors.Black : label6.Tag="label6" : label6.TextSize = 16
label6.Text = OrderSubTTL(I)
Panel5.AddView(label6,330dip,5dip,70dip,30dip)
PanelTop=PanelTop+PanelHeight+1dip
End Sub