Sub CriaPnl(h As Int, w As Int, T As String, T1 As String, tipo As Int, PanX As Panel) As Panel
Dim pnl As Panel, lbl As Label, lbl1 As Label
PanX.Initialize("PanX")
lbl.initialize("lbl")
lbl1.initialize("lbl1")
btn1.initialize("btn1")
'pnl.Color=Colors.Blue
'==============================================================================================================
lbl.Text=T
lbl.TextSize = 16
lbl.TextColor = Colors.White
lbl.Visible=True
lbl.Gravity = Gravity.CENTER_VERTICAL
PanX.AddView(lbl,5dip, 0, 200dip, h)
'==============================================================================================================
Select tipo
Case 1 '==============================================================================================================
lbl1.Text=T1
lbl1.TextSize=16
lbl1.TextColor=Colors.White
lbl1.Gravity = Gravity.CENTER_VERTICAL
PanX.AddView( lbl1, 200dip, 0, 80dip, h)
Case 2 '======================================== Forma de Pgto ======================================================================
spinn.TextSize=16
spinn.TextColor=Colors.White
spinn.AddAll(Array As String("Dinheiro", "C.Débito", "C.Credito", "Vale"))
spinn.Color=Colors.Red
spinn.DropdownBackgroundColor=Colors.red
PanX.AddView( spinn, 190dip, 0, 120dip, h-10)
spinn.Padding = Array As Int (2dip, 0dip, 0dip, 0dip)
spinn.Height=30dip
Case 3 '======================================== Forma de Entrega ======================================================================
spinn1.TextSize=16
spinn1.TextColor=Colors.White
spinn1.AddAll(Array As String("Retira", "Delivery"))
spinn1.Color=Colors.red
spinn1.DropdownBackgroundColor=Colors.red
PanX.AddView( spinn1, 190dip, 0, 120dip, h-10)
spinn1.Padding = Array As Int (2dip, 0dip, 0dip, 0dip)
spinn1.Height=30dip
Dim r As Reflector
r.Target = spinn1
'r.SetOnClickListener("Teste")
' You probably want setOnItemClickListener instead
'r.SetOnKeyListener("Teste1")
Case 4 '======================================== Botão OK! ======================================================================
btn1.TextSize=16
btn1.TextColor=Colors.White
btn1.Color=Colors.Magenta
btn1.Padding = Array As Int (2dip, 3dip, 0dip, 0dip)
btn1.Text="Ok!"
PanX.AddView(btn1, 190dip, 0, 120dip, h)
Dim r As Reflector
r.Target = btn1
'r.SetOnTouchListener("OkBTN_Touch")
'If sub_Click <> "" Then r.SetOnClickListener("pnlSV_Click")
r.SetOnClickListener("OkBTN_Click")
'If sub_LongClick <> "" Then r.SetOnLongClickListener("pnlSV_LongClick") Then r.SetOnClickListener("pnlSV_Click")
End Select
Return PanX
End Sub
'